/* French Learning App - Dark Mode Study Design */
/* ============================================= */

:root {
    /* Dark theme colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --bg-input: #0f0f15;

    /* French-inspired accents */
    --accent-blue: #0055A4;
    --accent-blue-light: #3d7fc4;
    --accent-red: #EF4135;
    --accent-red-light: #ff6b5e;
    --accent-gold: #ffd700;

    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;

    /* Borders & effects */
    --border-color: #2a2a3a;
    --border-subtle: #1f1f2a;
    --glow-blue: rgba(0, 85, 164, 0.3);
    --glow-red: rgba(239, 65, 53, 0.3);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================= */
/* Password Modal */
/* ============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 60px var(--glow-blue);
    animation: slideUp 0.4s ease;
}

.modal-large {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
    padding: 2rem;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--accent-red);
    color: white;
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.modal-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content>p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

#password-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#password-form input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

#password-form input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--glow-blue);
}

.error-text {
    color: var(--accent-red);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    animation: shake 0.4s ease;
}

.error-text.hidden {
    display: none;
}

/* ============================================= */
/* Buttons */
/* ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-light));
    color: white;
    box-shadow: 0 4px 15px var(--glow-blue);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--glow-blue);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card);
}

.btn-danger {
    color: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
}

.btn-danger:hover {
    background: rgba(239, 65, 53, 0.1) !important;
    border-color: var(--accent-red-light) !important;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    animation: spin 1s linear infinite;
}

.spinner.hidden {
    display: none;
}

/* ============================================= */
/* App Layout & Sidebar (New) */
/* ============================================= */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo .flag {
    font-size: 1.75rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #fff, var(--accent-blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    width: 100%;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-btn.active {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-btn.active svg {
    color: var(--accent-blue);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================= */
/* Main Content Area */
/* ============================================= */

.app-content {
    flex: 1;
    margin-left: 260px;
    /* Width of sidebar */
    padding: 2rem 3rem;
    max-width: 1600px;
}

/* Header Row in Content */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-sm {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
}

/* ============================================= */
/* Library & Filters */
/* ============================================= */

.library-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    align-items: center;
    /* Center items vertically */
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0 1rem 0 2.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    height: 46px;
    /* Explicit height */
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.library-filters select,
.library-filters input[type="date"] {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    outline: none;
    height: 46px;
    /* Match height */
}

/* ============================================= */
/* Notes Grid */
/* ============================================= */

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 220px;
    position: relative;
    overflow: hidden;
}

.note-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.note-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
}

.note-tags {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

/* =============================================
   Classwork Table View
   ============================================= */

.cw-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.cw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.cw-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.cw-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    user-select: none;
}

.cw-table th.sortable {
    cursor: pointer;
    transition: var(--transition-fast);
}

.cw-table th.sortable:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.cw-table th .sort-icon {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.5;
    display: inline-block;
    width: 12px;
}

.cw-table th.sorted-asc .sort-icon,
.cw-table th.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--accent-blue-light);
}

.cw-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

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

.cw-table tbody tr:active {
    background: var(--bg-secondary);
}

.cw-table td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
}

.cw-table td:first-child {
    font-weight: 500;
    color: var(--accent-blue-light);
    white-space: nowrap;
}

.cw-table td:nth-child(2) {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cw-table td:nth-child(3) {
    color: var(--text-primary);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-table .cw-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.cw-table .cw-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.cw-table .empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
    font-style: italic;
}

/* Responsive table for mobile */
@media (max-width: 768px) {
    .cw-table-wrapper {
        border-radius: var(--radius-md);
    }

    .cw-table th,
    .cw-table td {
        padding: 0.75rem 1rem;
    }

    .cw-table th:nth-child(4),
    .cw-table td:nth-child(4) {
        display: none;
        /* Hide tags on mobile */
    }

    .cw-table td:nth-child(3) {
        max-width: 200px;
    }
}

/* =============================================
   Image Upload Zone
   ============================================= */

.image-upload-section {
    margin-bottom: 1rem;
}

.image-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--bg-input);
}

.image-upload-zone:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 85, 164, 0.05);
}

.image-upload-zone.dragover {
    border-color: var(--accent-blue-light);
    background: rgba(0, 85, 164, 0.1);
    transform: scale(1.01);
}

.image-upload-zone.disabled {
    opacity: 0.4;
    pointer-events: none;
}

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

.upload-placeholder svg {
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.upload-placeholder p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.upload-link {
    color: var(--accent-blue-light);
    text-decoration: underline;
    cursor: pointer;
}

.image-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.image-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumb .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: var(--accent-red);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    line-height: 1;
}

.image-thumb .remove-btn:hover {
    background: var(--accent-red-light);
    transform: scale(1.1);
}

.image-thumb.uploading {
    opacity: 0.6;
}

.image-thumb.uploading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--accent-blue-light);
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================= */
/* Editor View */
/* ============================================= */

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.btn-text {
    background: none;
    padding: 0;
    color: var(--text-secondary);
    font-weight: normal;
}

.btn-text:hover {
    color: var(--text-primary);
    background: none;
    text-decoration: underline;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.editor-meta {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.editor-content-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 600px;
}

.editor-pane {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.editor-pane textarea {
    flex: 1;
    resize: none;
    line-height: 1.6;
    font-family: inherit;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 1.5rem;
    /* Increased Padding */
    border: 1px solid var(--border-color);
}

/* ============================================= */
/* Vocabulary Detail View Styles */
/* ============================================= */
.vocab-table {
    display: grid;
    gap: 0.5rem;
}

.vocab-row,
.vocab-table-header {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 0.5fr 3fr;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
}

.vocab-table-header {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
}

.vocab-row:last-child {
    border-bottom: none;
}

.vocab-en {
    color: var(--text-secondary);
}

.vocab-gender {
    font-weight: bold;
    text-transform: uppercase;
    color: var(--accent-purple-light);
    font-size: 0.8rem;
}

.vocab-sentence {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.verb-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.verb-title {
    color: var(--accent-green);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.conjugation-list {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

@media (max-width: 768px) {

    .vocab-row,
    .vocab-table-header {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .vocab-gender {
        display: inline-block;
        margin-left: 0.5rem;
    }

    .vocab-sentence {
        display: block;
        margin-top: 0.2rem;
    }
}

#editor-formatted {
    background: var(--bg-secondary);
    border-color: var(--border-subtle);
    color: var(--text-primary);
    /* Bright White Text */
    font-size: 1rem;
}

/* ============================================= */
/* Cards */
/* ============================================= */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 30px rgba(0, 85, 164, 0.1);
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.card-wide {
    grid-column: 1 / -1;
}

/* ============================================= */
/* Forms */
/* ============================================= */

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    /* Bright White Text */
    font-family: inherit;
    transition: var(--transition-fast);
    resize: vertical;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--glow-blue);
}

/* Search Input (Vocabulary) */
.search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-fast);
    margin-bottom: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--glow-blue);
}

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

.form-group textarea {
    min-height: 100px;
    padding: 1rem;
}

/* ============================================= */
/* Entry Lists */
/* ============================================= */

.entry-list {
    max-height: 500px;
    overflow-y: auto;
}

.entry-list::-webkit-scrollbar {
    width: 6px;
}

.entry-list::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 3px;
}

.entry-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.entry-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Gender Badge */
.gender-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.gender-badge.masculine {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.gender-badge.feminine {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

/* Sentences List */
.sentences-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sentence-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    border-left: 3px solid var(--accent-blue);
}

.sentence-french {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.sentence-english {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.entry-item {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.entry-item:hover {
    border-color: var(--accent-blue);
    background: var(--bg-secondary);
}

.entry-date {
    font-size: 0.8rem;
    color: var(--accent-blue-light);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.entry-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-light));
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* ============================================= */
/* Vocabulary Sub-tabs */
/* ============================================= */

.sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.sub-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sub-tab:hover {
    color: var(--text-primary);
}

.sub-tab.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 15px var(--glow-blue);
}

.vocab-content {
    display: none;
}

.vocab-content.active {
    display: block;
}

/* ============================================= */
/* Verb Type Selector */
/* ============================================= */

.verb-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.verb-btn {
    padding: 0.75rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.verb-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.verb-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* ============================================= */
/* Quiz Area */
/* ============================================= */

.quiz-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.quiz-area.hidden {
    display: none;
}

.quiz-word {
    text-align: center;
    padding: 2rem;
}

.quiz-word h4 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.quiz-word p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.quiz-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.quiz-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quiz-btn.masculine {
    background: var(--accent-blue);
    color: white;
}

.quiz-btn.masculine:hover {
    box-shadow: 0 4px 20px var(--glow-blue);
    transform: translateY(-2px);
}

.quiz-btn.feminine {
    background: var(--accent-red);
    color: white;
}

.quiz-btn.feminine:hover {
    box-shadow: 0 4px 20px var(--glow-red);
    transform: translateY(-2px);
}

.quiz-result {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.quiz-result.correct {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.quiz-result.incorrect {
    background: rgba(239, 65, 53, 0.2);
    color: var(--accent-red);
}

.quiz-progress {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* ============================================= */
/* Detail View (Legacy Modal - optional for other sections) */
/* ============================================= */

#detail-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-blue-light);
}

#detail-content .detail-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

#detail-content .detail-section {
    margin-bottom: 1.5rem;
}

#detail-content .detail-section h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#detail-content .detail-body {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: var(--radius-md);
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.7;
}

#detail-content .detail-body h1,
#detail-content .detail-body h2,
#detail-content .detail-body h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

#detail-content .detail-body ul,
#detail-content .detail-body ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

/* ============================================= */
/* Toast Notifications */
/* ============================================= */

#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.3s ease;
    min-width: 280px;
}

.toast.success {
    border-color: #22c55e;
}

.toast.error {
    border-color: var(--accent-red);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

/* ============================================= */
/* Quizzes Styles */
/* ============================================= */

.quiz-content-area {
    margin-top: 1.5rem;
}

.quiz-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.quiz-answer-key {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    color: var(--accent-green);
    font-weight: 500;
}

.mcq-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.mcq-badge {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.audio-player-box {
    background: var(--bg-input);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.reading-passage {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-family: 'Georgia', serif;
    line-height: 1.8;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-blue);
    font-size: 1.05rem;
}

.prompt-box {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.model-answer {
    white-space: pre-line;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

/* ============================================= */
/* Animations */
/* ============================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

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

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================= */
/* Chat Styles */
/* ============================================= */

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    max-width: 80%;
}

.message.user-message {
    align-self: flex-end;
}

.message.ai-message {
    align-self: flex-start;
}

.message-content {
    padding: 1rem;
    border-radius: var(--radius-lg);
    line-height: 1.5;
    font-size: 1rem;
    position: relative;
    white-space: pre-wrap;
}

.user-message .message-content {
    background: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-content {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: 1.5rem;
    background: var(--bg-header);
    border-top: 1px solid var(--border-subtle);
}

.chat-input-area .input-group {
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.chat-input-area input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.chat-input-area button {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================= */
/* Responsive Design & Mobile Drawer */
/* ============================================= */

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 1000;
}

.mobile-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.nav-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

@media (max-width: 900px) {

    /* Show Mobile Header */
    .mobile-header {
        display: flex;
    }

    /* Layout Adjustments */
    .app-layout {
        flex-direction: column;
    }

    /* Sidebar as Drawer */
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 1002;
        background: var(--bg-card);
        border-right: 1px solid var(--border-subtle);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    /* Content Area */
    .app-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem;
        /* Space for mobile header */
        width: 100%;
    }

    /* Adjust Grid Layouts for Mobile */
    .notes-grid,
    .content-grid,
    .editor-content-split {
        grid-template-columns: 1fr !important;
    }

    .editor-pane textarea {
        min-height: 200px;
    }

    /* Chat fit to screen */
    .chat-container {
        height: calc(100vh - 140px);
    }

    /* Nav Buttons */
    .main-nav {
        padding-bottom: 5rem;
        /* Allow scroll past bottom */
    }

    /* Typography adjustments */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .display-text {
        font-size: 2rem;
    }
}

/* ============================================= */
/* Utility Classes */
/* ============================================= */

.hidden {
    display: none !important;
}