*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --warning-color: #f59e0b;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    width: 100%;
    overflow: hidden;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    gap: 1rem;
    box-sizing: border-box;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-brand::before {
    content: '';
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.nav-menu {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-menu > span,
.nav-welcome {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Mobile Navigation Header - Hidden on Desktop */
.nav-mobile-header {
    display: none;
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Mobile Header User */
.nav-mobile-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.nav-mobile-username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Mobile Avatar */
.nav-mobile-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
    text-transform: uppercase;
}

/* Mobile Bottom Navigation - Hidden on Desktop */
.mobile-bottom-nav {
    display: none;
}

/* Bottom Navigation Styles (for mobile) */
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.625rem 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 500;
    transition: var(--transition);
    flex: 1 1 0;
    min-width: 0;
    max-width: 25%;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
    flex-shrink: 0;
}

.bottom-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active {
    position: relative;
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
}

/* Auth Box */
.auth-box {
    max-width: 440px;
    margin: 3rem auto;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.auth-box h1 {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
}

.auth-box .btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.auth-box p {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-box p a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.auth-box p a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    margin-bottom: 1.25rem;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h3 {
    margin: 1.25rem 0 0.75rem;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--card-bg);
    color: var(--text-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* File Input */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-color);
}

.file-upload-wrapper:hover,
.file-upload-wrapper.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.file-upload-icon svg {
    width: 24px;
    height: 24px;
}

.file-upload-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.file-upload-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.file-name-display {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--success-light);
    border-radius: var(--radius-sm);
    color: var(--success-color);
    font-size: 0.875rem;
    font-weight: 500;
    display: none;
}

.file-name-display.show {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.alert-success {
    background-color: var(--success-light);
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-error {
    background-color: var(--danger-light);
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* API Info */
.api-info {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.info-row {
    margin-bottom: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row strong {
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

code {
    background: rgba(0, 0, 0, 0.3);
    color: #4ade80;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    display: block;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.8125rem;
    word-break: break-all;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.usage-example {
    margin-top: 1.25rem;
    background: var(--bg-color);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.usage-example h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.usage-example pre {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.7;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    margin: 0;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: var(--bg-color);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table td {
    font-size: 0.875rem;
    color: var(--text-color);
}

.table td form {
    margin: 0;
}

.table .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* File Type Badge */
.file-type-badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-warning {
    color: var(--warning-color);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.text-small {
    font-size: 0.8125rem;
}

/* API Credentials */
.api-credentials {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.api-credentials h3 {
    margin-top: 0;
    margin-bottom: 0.875rem;
    font-size: 0.9375rem;
}

.api-credentials p {
    margin-bottom: 0.5rem;
    word-break: break-all;
    font-size: 0.875rem;
    text-align: left;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.empty-state-icon svg {
    width: 32px;
    height: 32px;
}

.empty-state h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.empty-state p {
    font-size: 0.875rem;
    margin: 0;
}

/* Copy Button */
.copy-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.copy-btn:hover {
    color: var(--primary-color);
}

.copy-btn.copied::after {
    content: 'Copied!';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading .spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Tablet Breakpoint */
@media (max-width: 1024px) {
    .container {
        padding: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   MOBILE VIEW (max-width: 768px)
   Professional Mobile-First Design
   ========================================== */
@media (max-width: 768px) {
    /* Base Reset for Mobile */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    body {
        padding-bottom: 70px; /* Space for bottom nav */
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        margin: 0;
    }

    /* ========== MOBILE NAVBAR ========== */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .navbar .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.875rem 1rem;
        min-height: 56px;
    }

    /* Hide Desktop Nav */
    .nav-desktop {
        display: none !important;
    }

    /* Show Mobile Header */
    .nav-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .nav-mobile-header .nav-brand {
        font-size: 1.125rem;
    }

    .nav-mobile-header .nav-brand::before {
        width: 28px;
        height: 28px;
    }

    .nav-mobile-user {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-mobile-username {
        font-size: 0.8125rem;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-mobile-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }

    /* Add top padding to content for fixed navbar */
    .dashboard {
        padding-top: 56px;
    }

    /* ========== MOBILE BOTTOM NAV ========== */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 64px;
        background: var(--card-bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
        z-index: 1000;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-bottom-nav .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 4px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.625rem;
        font-weight: 500;
        gap: 4px;
        transition: color 0.2s ease;
        max-width: none;
        min-width: 0;
    }

    .mobile-bottom-nav .bottom-nav-item svg {
        width: 24px;
        height: 24px;
        stroke-width: 1.5;
    }

    .mobile-bottom-nav .bottom-nav-item span {
        line-height: 1;
    }

    .mobile-bottom-nav .bottom-nav-item:hover,
    .mobile-bottom-nav .bottom-nav-item.active {
        color: var(--primary-color);
    }

    .mobile-bottom-nav .bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 3px;
        background: var(--primary-color);
        border-radius: 0 0 4px 4px;
    }

    /* ========== CARDS & CONTENT ========== */
    .card {
        padding: 1rem;
        border-radius: var(--radius-sm);
        margin-bottom: 1rem;
    }

    .card h2 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .card h2 svg {
        width: 20px;
        height: 20px;
    }

    /* ========== AUTH BOX ========== */
    .auth-box {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: var(--radius);
    }

    .auth-box h1 {
        font-size: 1.5rem;
    }

    .auth-box h2 {
        font-size: 0.9375rem;
        margin-bottom: 1.5rem;
    }

    /* ========== FILE UPLOAD ========== */
    .file-upload-wrapper {
        padding: 1.5rem 1rem;
    }

    .file-upload-icon {
        width: 40px;
        height: 40px;
    }

    .file-upload-icon svg {
        width: 20px;
        height: 20px;
    }

    .file-upload-text {
        font-size: 0.8125rem;
    }

    /* ========== FILE LIST - CARD VIEW ========== */
    .file-table-desktop {
        display: none !important;
    }

    .file-cards-mobile {
        display: block !important;
    }

    .file-card-mobile {
        background: var(--bg-color);
        border-radius: var(--radius-sm);
        padding: 0.875rem;
        margin-bottom: 0.625rem;
        border: 1px solid var(--border-color);
    }

    .file-card-mobile:last-child {
        margin-bottom: 0;
    }

    .file-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.625rem;
    }

    .file-card-name {
        font-weight: 600;
        font-size: 0.875rem;
        color: var(--text-color);
        word-break: break-word;
        flex: 1;
        line-height: 1.3;
    }

    .file-card-mobile .file-type-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
        flex-shrink: 0;
    }

    .file-card-meta {
        display: flex;
        gap: 1rem;
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-bottom: 0.75rem;
    }

    .file-card-meta span {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .file-card-meta svg {
        width: 14px;
        height: 14px;
    }

    .file-card-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .file-card-actions .btn {
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .file-card-actions form {
        display: contents;
    }

    /* ========== API INFO ========== */
    .api-info {
        padding: 1rem;
        border-radius: var(--radius-sm);
    }

    .info-row {
        margin-bottom: 0.75rem;
    }

    .info-row strong {
        font-size: 0.6875rem;
    }

    code {
        font-size: 0.6875rem;
        padding: 0.375rem 0.5rem;
    }

    .usage-example {
        padding: 1rem;
        margin-top: 1rem;
    }

    .usage-example h3 {
        font-size: 0.8125rem;
    }

    .usage-example pre {
        font-size: 0.625rem;
        padding: 0.75rem;
        line-height: 1.5;
    }

    /* ========== STATS GRID ========== */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.625rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-card .stat-value {
        font-size: 1.375rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    /* ========== BUTTONS ========== */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    /* ========== MODAL ========== */
    .modal {
        padding: 0.75rem;
    }

    .modal-content {
        padding: 1.25rem;
        border-radius: var(--radius);
        max-height: 85vh;
    }

    .modal-content h2 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* ========== ALERTS ========== */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
        border-radius: var(--radius-sm);
    }

    .alert svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    /* ========== FORMS ========== */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }

    .form-group input {
        padding: 0.75rem;
        font-size: 1rem; /* Prevents zoom on iOS */
    }

    /* ========== EMPTY STATE ========== */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-icon {
        width: 56px;
        height: 56px;
    }

    .empty-state-icon svg {
        width: 28px;
        height: 28px;
    }

    .empty-state h3 {
        font-size: 0.9375rem;
    }

    .empty-state p {
        font-size: 0.8125rem;
    }

    /* ========== TABLE (for admin) ========== */
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .table {
        min-width: 500px;
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.625rem 0.5rem;
    }

    .table .actions {
        gap: 0.375rem;
    }

    .table .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
    }
}

/* ==========================================
   DESKTOP VIEW (min-width: 769px)
   ========================================== */
@media (min-width: 769px) {
    .file-cards-mobile {
        display: none !important;
    }

    .file-table-desktop {
        display: block !important;
    }

    .mobile-bottom-nav {
        display: none !important;
    }

    .nav-mobile-header {
        display: none !important;
    }

    .nav-desktop {
        display: flex !important;
    }
}

/* ==========================================
   SMALL MOBILE (max-width: 375px)
   ========================================== */
@media (max-width: 375px) {
    .container {
        padding: 0.75rem;
    }

    .navbar .container {
        padding: 0.75rem;
    }

    .nav-mobile-username {
        display: none;
    }

    .card {
        padding: 0.875rem;
    }

    .file-card-actions {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .mobile-bottom-nav .bottom-nav-item span {
        font-size: 0.5625rem;
    }
}

/* ==========================================
   TOUCH DEVICES
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px;
    }

    .form-group input {
        min-height: 48px;
    }

    .bottom-nav-item {
        min-height: 48px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .file-upload-wrapper,
    .modal {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

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

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

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* Dark mode support (optional - follows system preference) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --text-color: #f1f5f9;
        --text-muted: #94a3b8;
        --text-light: #64748b;
        --border-color: #334155;
        --border-light: #1e293b;
        --primary-light: rgba(59, 130, 246, 0.15);
        --success-light: rgba(16, 185, 129, 0.15);
        --danger-light: rgba(239, 68, 68, 0.15);
    }

    .navbar {
        background: rgba(15, 23, 42, 0.95);
    }

    .form-group input {
        background: var(--bg-color);
        border-color: var(--border-color);
    }

    .form-group input:focus {
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }

    .file-upload-wrapper {
        background: var(--bg-color);
        border-color: var(--border-color);
    }

    .file-upload-wrapper:hover,
    .file-upload-wrapper.dragover {
        background: var(--primary-light);
    }

    .usage-example {
        background: var(--bg-color);
        border-color: var(--border-color);
    }

    .table th {
        background: var(--bg-color);
    }

    .table tbody tr:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .btn-outline {
        border-color: var(--border-color);
        color: var(--text-color);
    }

    .btn-outline:hover {
        background: var(--border-color);
    }
}
