/* Modern Design System - Vocabulary Builder */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Grays */
    --bg-body: #F7FAFC;
    --bg-card: #FFFFFF;
    --text-main: #2D3748;
    --text-muted: #718096;
    --border-color: #E2E8F0;

    /* Brand */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --accent: #10B981;

    /* Shadow & Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

h1,
h2,
h3,
h4,
h5 {
    margin-top: 0;
    color: #1a202c;
    letter-spacing: -0.02em;
}

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

/* Navbar */
.navbar {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.75rem 1rem;
}

.nav-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

/* Components */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

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

/* Utilities */
.badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

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

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

/* Mobile Bottom Bar (Optional for Auth User) */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }

    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-around;
        padding: 10px 0;
        z-index: 100;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 0.75rem;
        color: var(--text-muted);
    }

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

    .bottom-nav-icon {
        font-size: 1.25rem;
        margin-bottom: 2px;
    }

    .container {
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    /* Better Mobile Cards */
    .card {
        padding: 1.25rem;
    }

    .grid {
        gap: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .view-toggle button {
        padding: 4px 8px;
        font-size: 0.9rem;
    }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

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

.page-actions {
    display: flex;
    gap: 10px;
}

/* Responsive Table */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.table-header h3 {
    margin: 0;
    color: var(--text-main);
}

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

.responsive-table th {
    background-color: #f7fafc;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.responsive-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.responsive-table tr:hover {
    background-color: #f8fafc;
}

/* Mobile Responsiveness for Table and Header */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-actions {
        width: 100%;
        flex-direction: column;
    }

    .page-actions .btn {
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        margin-bottom: 1rem;
        background: #fff;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }

    .responsive-table td {
        border-bottom: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
    }

    /* Specific tweaks for first column (User Info) on mobile */
    .responsive-table td:first-child {
        background-color: #f8fafc;
        border-bottom: 1px solid var(--border-color);
        display: block;
        text-align: left;
        padding: 1rem;
    }

    .responsive-table td:first-child::before {
        display: none;
    }

    /* Mobile Menu */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 60;
    }

    .mobile-menu-btn .bar {
        width: 100%;
        height: 3px;
        background-color: var(--text-main);
        border-radius: 3px;
    }

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

    .nav-links.show-mobile-menu {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--bg-body);
        width: 100%;
        text-align: center;
    }
}

/* Hide Mobile Menu Button on Desktop */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }
}