:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding-top: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    body {
        padding-top: calc(56px + 16px);
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: calc(56px + 12px);
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 12px;
    }
}

/* Top Navbar */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.settings-btn {
    background: #f0f2f5;
    border: none;
    color: #050505;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.settings-btn:hover {
    background: #e4e6eb;
    transform: rotate(90deg);
}

.settings-btn i {
    transition: inherit;
}

.container {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 20px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 16px;
    }
}

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
}

header h1 {
    color: var(--primary-color);
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    color: #7f8c8d;
    font-style: italic;
    font-size: 1.1em;
}

/* Auth Sidebar Styles */
.auth-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.auth-sidebar.active {
    right: 0;
}

/* Menu Sidebar (Left) */
.menu-sidebar {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.menu-sidebar.active {
    left: 0;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.home-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.menu-section {
    padding: 1rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
    gap: 1rem;
    font-size: 1rem;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.menu-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    background: white;
    color: #333;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e4e6eb;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.close-btn {
    background: #f0f2f5;
    border: none;
    color: #050505;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3em;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.close-btn:hover {
    background: #e4e6eb;
}

.sidebar-content {
    padding: 30px 25px;
}

.auth-state {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-message {
    text-align: center;
    color: #333;
}

.auth-message i {
    font-size: 4em;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
}

.auth-message p {
    font-size: 1em;
    line-height: 1.6;
    color: #666;
}

.auth-button {
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.google-btn {
    background: #fff;
    color: #444;
    border: 2px solid #ddd;
    margin-top: 20px;
}

.google-btn:hover {
    background: #f8f8f8;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.google-btn i {
    font-size: 1.2em;
    margin-right: -2px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-info h3 {
    margin: 0 0 3px;
    color: #333;
    font-size: 1em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    color: #666;
    font-size: 0.8em;
    word-break: break-word;
    margin: 0;
}

.logout-btn {
    background: #f0f2f5;
    border: none;
    color: #050505;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: #e4e6eb;
}

.logout-btn i {
    margin: 0;
}

/* Settings Section */
.settings-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e4e6eb;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.settings-title {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-item {
    margin-bottom: 20px;
}

/* Setting item with toggle switch */
.setting-item:has(.toggle-switch) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.setting-item:has(.toggle-switch) .setting-label {
    margin-bottom: 0;
    flex: 1;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.setting-label i {
    color: var(--primary-color);
}

.input-with-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Courier New', monospace;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.toggle-visibility-btn {
    background: #f0f2f5;
    border: none;
    color: #666;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.toggle-visibility-btn:hover {
    background: #e4e6eb;
    color: #333;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-label {
    background-color: var(--primary-color);
}

.toggle-input:checked + .toggle-label:before {
    transform: translateX(24px);
}

.toggle-input:focus + .toggle-label {
    box-shadow: 0 0 1px var(--primary-color);
}

.setting-status {
    display: block;
    font-size: 0.75em;
    margin-top: 6px;
    min-height: 18px;
}

@media (max-width: 768px) {
    .auth-sidebar {
        width: 100%;
        right: -100%;
    }

    .menu-sidebar {
        width: 100%;
        left: -100%;
    }

    .header-avatar,
    .settings-btn,
    .menu-btn {
        width: 40px;
        height: 40px;
    }

    .settings-btn,
    .menu-btn {
        font-size: 1.1em;
    }

    .header-actions {
        gap: 10px;
    }

    /* Mobile adjustments for toggle items */
    .setting-item:has(.toggle-switch) {
        gap: 12px;
    }

    .setting-label {
        font-size: 0.85em;
    }

    .toggle-switch {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {

    .header-avatar,
    .settings-btn,
    .menu-btn {
        width: 36px;
        height: 36px;
    }

    .settings-btn,
    .menu-btn {
        font-size: 1em;
    }

    .header-actions {
        gap: 8px;
        top: 50%;
        right: 6px;
    }

    /* Smaller toggle on very small screens */
    .setting-label {
        font-size: 0.8em;
        gap: 6px;
    }

    .toggle-switch {
        width: 44px;
        height: 24px;
    }

    .toggle-label:before {
        height: 18px;
        width: 18px;
    }

    .toggle-input:checked + .toggle-label:before {
        transform: translateX(20px);
    }

    .settings-section {
        margin-top: 24px;
        padding-top: 24px;
    }
}

/* Floating Action Button */
.floating-action-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: all 0.3s ease;
    z-index: 900;
}

.floating-action-btn.hidden {
    display: none;
}

.floating-action-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.floating-action-btn.active {
    transform: rotate(45deg);
}

/* FAB Menu */
.fab-menu {
    position: fixed;
    bottom: 90px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 899;
}

.fab-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border: none;
    border-radius: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fab-option:hover {
    background: #f8f8f8;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.fab-option i {
    font-size: 1.2em;
    color: var(--primary-color);
}

.fab-option span {
    color: #333;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Deck List Styles */
.deck-list-view {
    margin-top: 20px;
}

.deck-table {
    width: 100%;
}

.deck-header {
    display: grid;
    grid-template-columns: 1fr 100px 100px 50px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e4e6eb;
}

.deck-col {
    text-align: left;
}

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

.deck-rows {
    background: white;
}

.deck-row {
    display: grid;
    grid-template-columns: 1fr 100px 100px 50px;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
    align-items: center;
    cursor: pointer;
}

.deck-row:hover {
    background: #f8f9fa;
}

.deck-row.collapsed .deck-name-text {
    padding-left: 0;
}

.deck-row.expanded .deck-name-text {
    padding-left: 20px;
}

.deck-name-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.deck-expand-icon {
    width: 16px;
    font-size: 0.8em;
    color: #666;
}

.deck-stat-value {
    text-align: center;
    color: #666;
    font-weight: 500;
}

.deck-stat-new {
    color: #007bff;
}

.deck-stat-review {
    color: #28a745;
}

.deck-settings-btn {
    background: #f0f2f5;
    border: none;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.deck-settings-btn:hover {
    background: #e4e6eb;
    color: #333;
}

/* View Page Styles */
.view-page {
    margin-top: 20px;
    padding-bottom: 20px;
}

.view-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.view-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5em;
    flex: 1;
}

.back-btn {
    background: #f0f2f5;
    border: none;
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #e4e6eb;
    transform: translateX(-2px);
}

.edit-card-btn {
    background: #f0f2f5;
    border: none;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.edit-card-btn:hover {
    background: #e4e6eb;
    color: #333;
}

.edit-card-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #ff5252;
}

.update-btn {
    background: #667eea;
}

.update-btn:hover {
    background: #5568d3;
}

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

.delete-btn:hover {
    background: #ff5252;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
}

/* Checkbox styling */
.form-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.form-group.checkbox-group label {
    display: inline;
    cursor: pointer;
    font-weight: 500;
}

/* Review View Styles */
.card-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 40px;
    margin: 30px 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-text {
    font-size: 1.5em;
    line-height: 1.6;
    color: #333;
    text-align: center;
    word-wrap: break-word;
    user-select: text;
    transition: opacity 0.2s ease;
}

/* Only show pointer cursor and hover effect for cloze cards */
.card-text.cloze-card {
    cursor: pointer;
    user-select: none;
}

.card-text.cloze-card:hover {
    opacity: 0.8;
}

/* Paragraph type styling */
.card-text.paragraph-type {
    text-align: left;
    font-size: 1.1em;
    white-space: pre-wrap;
}

/* Card Preview */
.preview-btn {
    width: 100%;
    padding: 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 10px;
}

.preview-btn:hover {
    background: #5a6268;
}

.preview-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.preview-btn i {
    margin-right: 8px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.preview-header label {
    font-weight: 600;
    color: #333;
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.preview-action-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.preview-action-btn:hover {
    background: #e9ecef;
    color: #333;
}

.preview-action-btn i {
    font-size: 0.9em;
}

.cloze-hidden {
    color: #007bff;
    font-weight: 600;
}

.card-progress {
    text-align: center;
    margin-top: 10px;
    padding: 4px 8px;
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

.card-progress.hidden {
    display: none;
}

.card-progress .count-new {
    color: #007bff;
    font-weight: 600;
}

.card-progress .count-review {
    color: #28a745;
    font-weight: 600;
}

.show-answer-btn {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.show-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.show-answer-btn.hidden {
    display: none;
}

.review-buttons {
    display: none; /* Hidden by default, shown after reveal */
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 20px;
    padding-top: 12px;
}

.review-buttons.visible {
    display: grid;
}

.review-btn {
    padding: 15px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.review-btn-again {
    background: #dc3545;
}

.review-btn-again:hover {
    background: #c82333;
}

.review-btn-hard {
    background: #ffc107;
}

.review-btn-hard:hover {
    background: #e0a800;
}

.review-btn-good {
    background: #28a745;
}

.review-btn-good:hover {
    background: #218838;
}

.review-btn-easy {
    background: #007bff;
}

.review-btn-easy:hover {
    background: #0056b3;
}

.btn-label {
    display: block;
}

@media (max-width: 480px) {
    .card-text {
        font-size: 1.3em;
    }

    .card-container {
        padding: 40px 20px;
        min-height: 150px;
        margin: 20px 0;
    }

    .card-progress {
        position: fixed;
        bottom: 54px;
        left: 0;
        right: 0;
        margin: 0;
        padding: 8px;
        background: white;
        border-top: 1px solid #eee;
        z-index: 99;
    }

    .show-answer-btn {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 16px;
        border-radius: 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }

    .review-buttons {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        grid-template-columns: repeat(4, 1fr);
        gap: 0;
        margin: 0;
        padding: 0;
        background: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }

    .review-btn {
        padding: 32px 8px;
        font-size: 0.85em;
        border-radius: 0;
        box-shadow: none;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
    }

    .review-btn:last-child {
        border-right: none;
    }

    .view-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .view-header h2 {
        font-size: 1.3em;
    }

    #reviewContent {
        padding-bottom: 10px;
    }
}

@media (max-width: 768px) {

    .deck-header,
    .deck-row {
        grid-template-columns: 1fr 70px 70px 45px;
    }

    .deck-col,
    .deck-stat-value {
        font-size: 0.9em;
    }

    .deck-settings-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9em;
    }
}

/* Stats Page Styles */
.stats-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.stats-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-title {
    font-size: 1.8em;
    margin: 0 0 5px 0;
    color: #333;
}

.stats-subtitle {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 0.95em;
}

.stats-deck-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.stats-deck-filter label {
    color: #666;
    font-size: 0.95em;
    font-weight: 500;
}

.stats-deck-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    color: #333;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.stats-deck-select:hover {
    border-color: var(--primary-color);
}

.stats-deck-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.1);
}

.time-range-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.time-range-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.time-range-option input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.time-range-option span {
    font-size: 0.95em;
    color: #333;
}

.chart-container {
    margin: 25px 0;
    position: relative;
    height: 300px;
}

.chart-container canvas {
    max-width: 100%;
}

.stats-summary {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.stat-label {
    color: #666;
    font-size: 0.95em;
}

.stat-value {
    color: #333;
    font-weight: 600;
    font-size: 1em;
}

@media (max-width: 768px) {
    .stats-container {
        padding: 0 15px;
    }

    .stats-section {
        padding: 20px 15px 15px 15px;
    }

    .stats-title {
        font-size: 1.5em;
    }

    .stats-deck-filter {
        margin-bottom: 15px;
    }

    .stats-deck-filter label {
        font-size: 0.9em;
        min-width: 45px;
    }

    .stats-deck-select {
        font-size: 0.9em;
        padding: 6px 10px;
    }

    .chart-container {
        height: 150px;
        margin: 20px 0;
    }

    .stats-summary {
        margin-top: 20px;
        padding-top: 15px;
    }

    .time-range-selector {
        gap: 12px;
    }

    .time-range-option span {
        font-size: 0.9em;
    }
}

/* Test Prompt Section */
.test-prompt-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.test-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.test-prompt-header label {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.test-prompt-btn {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.test-prompt-btn:hover {
    background: #357abd;
}

.test-prompt-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.test-prompt-btn i {
    font-size: 0.85em;
}

.test-input {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.test-output {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.test-output-header {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.test-output-content {
    color: #555;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.test-output-content.loading {
    color: #999;
    font-style: italic;
}

.test-output-content.error {
    color: #d32f2f;
}

/* Mobile responsiveness for test prompt */
@media (max-width: 768px) {
    .test-prompt-section {
        padding: 12px;
    }

    .test-prompt-header {
        flex-direction: row;
        gap: 8px;
    }

    .test-prompt-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .test-input {
        min-height: 60px;
        font-size: 0.95em;
    }

    .test-output {
        padding: 10px;
    }

    .test-output-content {
        font-size: 0.9em;
    }
}

/* Date input styling - make entire input clickable */
input[type="date"] {
    cursor: pointer;
    position: relative;
}

/* Ensure the entire date input is clickable on WebKit browsers */
input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}

/* Show the actual calendar icon */
input[type="date"]::after {
    content: '\f073'; /* FontAwesome calendar icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
}

/* Selection Toolbar */
.selection-toolbar {
    margin-bottom: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
