/* MidiaGrab - Mobile Optimization CSS */

/* Variáveis CSS para temas */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

/* Mobile First Approach */

/* Tablets (768px and up) */
@media (min-width: 768px) {
    :root {
        font-size: 16px;
    }
}

/* Desktops (1024px and up) */
@media (min-width: 1024px) {
    :root {
        font-size: 16px;
    }
}

/* Celulares (até 767px) */
@media (max-width: 767px) {
    /* Body */
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Padding e Margin */
    .container {
        padding: 15px;
    }
    
    .section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* Typography */
    h1 {
        font-size: 24px !important;
        margin-bottom: 10px;
    }
    
    h2 {
        font-size: 20px !important;
        margin-bottom: 10px;
    }
    
    h3 {
        font-size: 18px !important;
        margin-bottom: 8px;
    }
    
    p {
        margin-bottom: 10px;
        font-size: 14px;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 16px !important;
        font-size: 14px !important;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        width: 100% !important;
        padding: 12px !important;
        font-size: 16px !important; /* Previne zoom no iOS */
        margin-bottom: 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    /* Grid Layout */
    .grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Flex Layout */
    .flex {
        flex-direction: column;
    }
    
    .flex-row {
        flex-direction: column;
    }
    
    /* Navigation */
    nav {
        padding: 10px 0;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        margin-bottom: 5px;
    }
    
    nav a {
        padding: 10px 15px;
        display: block;
    }
    
    /* Cards */
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .card-header {
        padding: 10px 0;
        margin-bottom: 10px;
    }
    
    .card-body {
        padding: 0;
    }
    
    .card-footer {
        padding: 10px 0;
        margin-top: 10px;
    }
    
    /* Tables */
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
    
    /* Modals */
    .modal-content {
        width: 95% !important;
        max-width: 100% !important;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Dropdowns */
    .dropdown-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: flex-end;
        z-index: 1000;
    }
    
    .dropdown-menu-content {
        width: 100%;
        background: white;
        border-radius: 12px 12px 0 0;
        padding: 20px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Tabs */
    .tabs {
        display: flex;
        overflow-x: auto;
        gap: 5px;
        margin-bottom: 15px;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Alerts */
    .alert {
        padding: 12px;
        margin-bottom: 10px;
        font-size: 13px;
    }
    
    /* Badges */
    .badge {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Video */
    video {
        max-width: 100%;
        height: auto;
    }
    
    /* Sidebar (se existir) */
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        width: 250px;
        height: 100vh;
        background: white;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Header */
    header {
        padding: 10px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .header-title {
        font-size: 18px;
        font-weight: 600;
    }
    
    .header-actions {
        display: flex;
        gap: 5px;
    }
    
    .header-actions button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Footer */
    footer {
        padding: 15px;
        font-size: 12px;
        text-align: center;
    }
    
    footer a {
        display: block;
        margin-bottom: 5px;
    }
    
    /* Loading Spinner */
    .spinner {
        width: 24px;
        height: 24px;
    }
    
    /* Touch-friendly */
    button,
    a,
    input[type="button"],
    input[type="submit"],
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    @media (hover: none) {
        button:hover,
        a:hover,
        .btn:hover {
            background-color: inherit;
            transform: none;
        }
    }
    
    /* Landscape orientation */
    @media (orientation: landscape) {
        header {
            padding: 8px 15px;
        }
        
        h1 {
            font-size: 20px;
        }
        
        .section {
            padding: 10px;
        }
    }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 20px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
    
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
    
    .btn {
        padding: 12px 20px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 24px;
    }
}

/* Desktops (1024px+) */
@media (min-width: 1024px) {
    .container {
        padding: 30px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
    
    .grid-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .grid-4 {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    
    .btn {
        padding: 12px 24px;
    }
    
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 28px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .no-print {
        display: none !important;
    }
    
    a {
        text-decoration: underline;
    }
    
    button {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f0f0f0;
        --text-secondary: #ccc;
        --text-light: #999;
        
        --bg-light: #1a1a1a;
        --bg-white: #2a2a2a;
        
        --border-color: #444;
        --border-light: #333;
    }
    
    body {
        background: var(--bg-light);
        color: var(--text-primary);
    }
    
    .card,
    .section {
        background: var(--bg-white);
        color: var(--text-primary);
    }
    
    input,
    select,
    textarea {
        background: var(--bg-white);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Utility Classes */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

.p-0 { padding: 0; }
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none !important; }
.visible { display: block !important; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

