/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Modern Color Palette */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-dark: #4f46e5;
    /* Indigo 600 */
    --primary-light: #818cf8;
    /* Indigo 400 */
    --secondary: #64748b;
    /* Slate 500 */
    --success: #10b981;
    /* Emerald 500 */
    --danger: #ef4444;
    /* Red 500 */
    --warning: #f59e0b;
    /* Amber 500 */
    --info: #3b82f6;
    /* Blue 500 */

    /* Backgrounds */
    --background: #f1f5f9;
    /* Slate 100 */
    --surface: #ffffff;
    /* White */

    /* Text */
    --text: #0f172a;
    /* Slate 900 */
    --text-light: #64748b;
    /* Slate 500 */
    --text-lighter: #94a3b8;
    /* Slate 400 */

    /* Borders */
    --border: #e2e8f0;
    /* Slate 200 */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Radius */
    --radius: 1rem;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

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

html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

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

.nav-links a {
    color: var(--text-light);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 0.5rem;
}

/* Mobile Menu */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    overflow-x: auto;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Forms */
input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    color: white;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text);
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-neutral {
    background: #f1f5f9;
    color: #64748b;
}

/* Mobile Utilities */
.mobile-hidden {
    display: table-cell;
}

/* Responsive Table Wrapper */

.container {
    padding: 0 1rem;
    width: 100%;
    overflow-x: hidden;
}

.dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.card {
    padding: 1rem;
    overflow-x: visible;
}

/* Responsive Table - Card View */
table,
thead,
tbody,
th,
td,
tr {
    display: block;
}

thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
}

tr {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

td {
    border: none;
    border-bottom: 1px solid var(--border);
    position: relative;
    padding: 0.75rem 1rem 0.75rem 50% !important;
    text-align: right;
    min-height: 3rem;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
}

td:last-child {
    border-bottom: none;
    justify-content: center;
    padding-left: 1rem !important;
}

td:before {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: 600;
    content: attr(data-label);
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Action column special handling */
td[data-label="Action"] {
    background: #f8fafc;
    border-top: 1px solid var(--border);
    border-radius: 0 0 0.75rem 0.75rem;
}

td[data-label="Action"]:before {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    color: white;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text);
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-neutral {
    background: #f1f5f9;
    color: #64748b;
}

/* Mobile Utilities */
.mobile-hidden {
    display: table-cell;
}

/* Responsive Table Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
        /* Keep hiding by default, but we will override for table cards */
    }

    .container {
        padding: 0 1rem;
        width: 100%;
        overflow-x: hidden;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1rem;
        overflow-x: visible;
    }

    /* Responsive Table - Card View */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid var(--border);
        border-radius: 0.75rem;
        margin-bottom: 1rem;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    td {
        border: none;
        border-bottom: 1px solid var(--border);
        position: relative;
        padding: 0.75rem 1rem 0.75rem 50% !important;
        text-align: right;
        min-height: 3rem;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
    }

    td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-left: 1rem !important;
    }

    td:before {
        position: absolute;
        top: 50%;
        left: 1rem;
        transform: translateY(-50%);
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        content: attr(data-label);
        color: var(--text-light);
        font-size: 0.85rem;
    }

    /* Action column special handling */
    td[data-label="Action"] {
        background: #f8fafc;
        border-top: 1px solid var(--border);
        border-radius: 0 0 0.75rem 0.75rem;
    }

    td[data-label="Action"]:before {
        display: none;
    }

    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1.5rem;
        background: var(--gradient-primary);
        color: white;
        border-radius: 0.75rem;
        font-weight: 600;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
        text-decoration: none;
    }

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
        color: white;
    }

    .btn-secondary {
        background: var(--surface);
        color: var(--text);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
    }

    .btn-secondary:hover {
        background: #f8fafc;
        border-color: #cbd5e1;
        color: var(--text);
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
        background: var(--surface);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
    }

    table {
        width: 100%;
        border-collapse: collapse;
    }

    th {
        background: #f8fafc;
        padding: 1rem;
        text-align: left;
        font-weight: 600;
        color: var(--text-light);
        border-bottom: 1px solid var(--border);
    }

    td {
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        color: var(--text);
    }

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

    /* Badges */
    .badge {
        display: inline-flex;
        align-items: center;
        padding: 0.25rem 0.75rem;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .badge-success {
        background: #dcfce7;
        color: #166534;
    }

    .badge-danger {
        background: #fee2e2;
        color: #991b1b;
    }

    .badge-neutral {
        background: #f1f5f9;
        color: #64748b;
    }

    /* Mobile Utilities */
    .mobile-hidden {
        display: table-cell;
    }

    /* Responsive Table Wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile Optimizations */
    @media (max-width: 768px) {
        .mobile-hidden {
            display: none;
            /* Keep hiding by default, but we will override for table cards */
        }

        .container {
            padding: 0 1rem;
            width: 100%;
            overflow-x: hidden;
        }

        .dashboard-grid {
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .card {
            padding: 1rem;
            overflow-x: visible;
        }

        /* Responsive Table - Card View */
        table,
        thead,
        tbody,
        th,
        td,
        tr {
            display: block;
        }

        thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }

        tr {
            border: 1px solid var(--border);
            border-radius: 0.75rem;
            margin-bottom: 1rem;
            background: var(--surface);
            box-shadow: var(--shadow-sm);
        }

        td {
            border: none;
            border-bottom: 1px solid var(--border);
            position: relative;
            padding: 0.75rem 1rem 0.75rem 50% !important;
            text-align: right;
            min-height: 3rem;
            display: flex !important;
            align-items: center;
            justify-content: flex-end;
        }

        td:last-child {
            border-bottom: none;
            justify-content: center;
            padding-left: 1rem !important;
        }

        td:before {
            position: absolute;
            top: 50%;
            left: 1rem;
            transform: translateY(-50%);
            width: 45%;
            padding-right: 10px;
            white-space: nowrap;
            text-align: left;
            font-weight: 600;
            content: attr(data-label);
            color: var(--text-light);
            font-size: 0.85rem;
        }

        /* Action column special handling */
        td[data-label="Action"] {
            background: #f8fafc;
            border-top: 1px solid var(--border);
            border-radius: 0 0 0.75rem 0.75rem;
        }

        td[data-label="Action"]:before {
            display: none;
        }

        /* Form Adjustments */
        form[style*="grid-template-columns"] {
            grid-template-columns: 1fr !important;
        }

        .btn {
            width: 100%;
        }

        /* Search Page Mobile Fixes */
        .search-hero {
            padding: 2rem 0;
            margin-bottom: 0;
            border-radius: 0 0 1rem 1rem;
        }

        .search-card {
            transform: translateY(-1px);
            box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
            color: white;
        }

        .btn-secondary {
            background: var(--surface);
            color: var(--text);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
        }

        .btn-secondary:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
            color: var(--text);
        }

        /* Tables */
        .table-container {
            overflow-x: auto;
            background: var(--surface);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            background: #f8fafc;
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            color: var(--text-light);
            border-bottom: 1px solid var(--border);
        }

        td {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            color: var(--text);
        }

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

        /* Badges */
        .badge {
            display: inline-flex;
            align-items: center;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .badge-success {
            background: #dcfce7;
            color: #166534;
        }

        .badge-danger {
            background: #fee2e2;
            color: #991b1b;
        }

        .badge-neutral {
            background: #f1f5f9;
            color: #64748b;
        }

        /* Mobile Utilities */
        .mobile-hidden {
            display: table-cell;
        }

        /* Responsive Table Wrapper */
        .table-responsive {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* Mobile Optimizations */
        @media (max-width: 768px) {
            .mobile-hidden {
                display: none;
                /* Keep hiding by default, but we will override for table cards */
            }

            .container {
                padding: 0 1rem;
                width: 100%;
                overflow-x: hidden;
            }

            .dashboard-grid {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            .card {
                padding: 1rem;
                overflow-x: visible;
            }

            /* Responsive Table - Card View */
            table,
            thead,
            tbody,
            th,
            td,
            tr {
                display: block;
            }

            thead tr {
                position: absolute;
                top: -9999px;
                left: -9999px;
            }

            tr {
                border: 1px solid var(--border);
                border-radius: 0.75rem;
                margin-bottom: 1rem;
                background: var(--surface);
                box-shadow: var(--shadow-sm);
            }

            td {
                border: none;
                border-bottom: 1px solid var(--border);
                position: relative;
                padding: 0.75rem 1rem 0.75rem 50% !important;
                text-align: right;
                min-height: 3rem;
                display: flex !important;
                align-items: center;
                justify-content: flex-end;
            }

            td:last-child {
                border-bottom: none;
                justify-content: center;
                padding-left: 1rem !important;
            }

            td:before {
                position: absolute;
                top: 50%;
                left: 1rem;
                transform: translateY(-50%);
                width: 45%;
                padding-right: 10px;
                white-space: nowrap;
                text-align: left;
                font-weight: 600;
                content: attr(data-label);
                color: var(--text-light);
                font-size: 0.85rem;
            }

            /* Action column special handling */
            td[data-label="Action"] {
                background: #f8fafc;
                border-top: 1px solid var(--border);
                border-radius: 0 0 0.75rem 0.75rem;
            }

            td[data-label="Action"]:before {
                display: none;
            }

            /* Form Adjustments */
            form[style*="grid-template-columns"] {
                grid-template-columns: 1fr !important;
            }

            .btn {
                width: 100%;
            }

            /* Search Page Mobile Fixes */
            .search-hero {
                padding: 2rem 0;
                margin-bottom: 0;
                border-radius: 0 0 1rem 1rem;
            }

            .search-card {
                margin-top: 1rem;
                box-shadow: var(--shadow);
            }
        }