/**
 * BIBLE MEMORY - Professional Styling
 * Memorization & Study Platform CSS
 */

/* ============================================
   LAYOUT & CONTAINERS
   ============================================ */

.streams-page {
    padding: 50px 15px 20px 15px;
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
}

.streams-header {
    margin-bottom: 25px;
    animation: slideInDown 0.4s ease-out;
}

.streams-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    max-height: 1000px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.streams-stats-bar.hidden {
    display: none;
    max-height: 0;
}

.stat-item {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #2563eb;
    transition: all 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.75em;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: #2563eb;
}

/* ============================================
   FILTER & SEARCH BAR
   ============================================ */

.streams-filter-bar {
    display: flex;
    gap: 10px;
    margin-top: 0;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.streams-search-input {
    flex: 1;
    min-width: 150px;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.streams-search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #f0f9ff;
}

.streams-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-select:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.filter-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.filter-select {
    padding: 8px 32px 8px 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

/* Category Dropdown */
.category-dropdown-wrapper {
    position: relative;
}

.category-dropdown-btn {
    min-width: 140px;
    text-align: left;
    padding: 8px 32px 8px 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.category-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    padding: 8px 0;
}

.category-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.85em;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-edit-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.category-edit-btn:hover {
    background: rgba(37, 99, 235, 0.1);
}

.category-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95em;
}

.category-dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

/* ============================================
   BLOCKS CONTAINER
   ============================================ */

.streams-blocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .streams-blocks-container {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.streams-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 1.1em;
}

/* ============================================
   STREAM BLOCKS
   ============================================ */

.stream-block {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
    border-left: 5px solid #2563eb;
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.3s ease-out;
    position: relative;
}

.stream-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stream-block:active {
    cursor: grabbing;
}

/* Color variants */
.stream-block.blue { border-left-color: #2563eb; }
.stream-block.yellow { border-left-color: #eab308; }
.stream-block.green { border-left-color: #22c55e; }
.stream-block.purple { border-left-color: #8b5cf6; }
.stream-block.pink { border-left-color: #ec4899; }

.stream-block-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.stream-block-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    opacity: 0.4;
}

.favorite-btn:hover {
    opacity: 0.7;
    transform: scale(1.2);
}

.favorite-btn.active {
    opacity: 1;
    color: #fbbf24;
    text-shadow: 0 0 4px rgba(251, 191, 36, 0.5);
}

.verse-reference {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95em;
    flex: 1;
    min-width: 150px;
}

.memorization-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-none {
    background: #f3f4f6;
    color: #6b7280;
}

.status-level-1 {
    background: #fef3c7;
    color: #92400e;
}

.status-level-2 {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.stream-block-menu {
    display: flex;
    gap: 4px;
}

.block-category-btn,
.block-menu-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.block-category-btn:hover,
.block-menu-btn:hover {
    background: #f3f4f6;
    color: #2563eb;
}

.block-category-btn {
    font-size: 1.4em;
    font-weight: bold;
    color: #9ca3af;
}

.block-category-btn:hover {
    color: #2563eb;
}

/* ============================================
   BLOCK CONTENT
   ============================================ */

.stream-block-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* STREAMS PAGE ONLY - Full verse text in stream blocks */
.stream-block .verse-text {
    font-size: 0.95em;
    line-height: 1.7;
    color: #374151;
    margin: 0;
    flex: 1;
    word-wrap: break-word;
    overflow: visible;
    white-space: normal;
    display: block;
}

.progress-container {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.progress-text {
    font-size: 0.8em;
    font-weight: 600;
    color: #2563eb;
    min-width: 35px;
    text-align: right;
}

/* ============================================
   BLOCK ACTIONS
   ============================================ */

.stream-block-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
}

.action-btn {
    padding: 8px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #6b7280;
}

.action-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}

.memorize-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border-color: #1d4ed8;
    grid-column: span 2;
}

.memorize-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.navigate-btn {
    background: #f3f4f6;
}

.navigate-btn:hover {
    background: #e5e7eb;
}

.color-btn {
    width: 100% !important;
    min-height: 34px;
    border: 2px solid transparent !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.2) !important;
}

.delete-btn {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.delete-btn:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* ============================================
   MEMORIZATION MODAL
   ============================================ */

.memorization-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.memorization-modal-content {
    display: flex;
    flex-direction: column;
}

.memorization-header {
    padding: 20px 24px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f0f9ff, #f5f3ff);
}

.memorization-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.3em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.memorization-body {
    padding: 24px;
}

.verse-display {
    background: #f9fafb;
    border-left: 4px solid #2563eb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.verse-full {
    font-size: 1.1em;
    line-height: 1.8;
    color: #1f2937;
    margin: 0 0 8px 0;
    font-style: italic;
}

.verse-reference {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9em;
    margin: 0;
}

.verse-reference-btn {
    background: none;
    border: none;
    font-weight: 600;
    color: #2563eb;
    font-size: 0.9em;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    font-family: inherit;
}

.verse-reference-btn:active {
    color: #1e40af;
}

/* Hover effects only on devices that support hover */
@media (hover: hover) {
    .verse-reference-btn {
        transition: all 0.2s ease;
    }

    .verse-reference-btn:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }
}

.verse-with-blanks {
    font-size: 1.05em;
    line-height: 1.8;
    color: #1f2937;
    margin: 0;
}

.reference-hint {
    font-size: 0.9em;
    color: #6b7280;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

/* Instruction text */
.level1-instruction,
.level2-instruction,
.level3-instruction {
    background: #fef3c7;
    border-left: 4px solid #eab308;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.level1-instruction p,
.level2-instruction p,
.level3-instruction p {
    margin: 0 0 8px 0;
    color: #78350f;
    font-size: 0.95em;
}

.level1-instruction p:last-child,
.level2-instruction p:last-child,
.level3-instruction p:last-child {
    margin: 0;
}

.example {
    font-family: 'Courier New', monospace;
    font-size: 0.9em !important;
    background: white;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0 0 0 !important;
}

/* ============================================
   INPUT FIELDS
   ============================================ */

.level1-practice,
.level2-practice {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.input-display {
    background: #f3f4f6;
    padding: 16px;
    border-radius: 8px;
    font-size: 1.2em;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    min-height: 45px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

.input-display .letter {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.1s ease;
}

.input-display .letter.correct {
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
}

.input-display .letter.incorrect {
    background: #fee2e2;
    color: #dc2626;
    animation: shake 0.3s ease;
}

.level3-display {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level3-output {
    font-size: 1.1em;
    line-height: 1.8;
    text-align: center;
    flex-wrap: wrap;
    display: flex;
    gap: 8px;
}

.level3-output .word {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    animation: wordAppear 0.2s ease-out;
}

.level3-output .word.correct {
    background: #dcfce7;
    color: #166534;
}

.level3-output .word.incorrect {
    background: #fee2e2;
    color: #dc2626;
}

.level3-output .placeholder {
    color: #9ca3af;
    font-style: italic;
}

@keyframes wordAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.memorization-input,
.memorization-textarea {
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 100px;
}

.memorization-input:focus,
.memorization-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #f0f9ff;
}

/* ============================================
   FEEDBACK & RESULTS
   ============================================ */

.memorization-feedback {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 50px;
    display: none;
}

.memorization-feedback.show {
    display: flex;
}

.feedback-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
}

.feedback-partial {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */

.submit-btn,
.advance-btn,
.retry-btn,
.finish-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.submit-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.advance-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.advance-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.retry-btn {
    background: #fbbf24;
    color: #78350f;
}

.retry-btn:hover {
    background: #f59e0b;
}

.finish-btn {
    background: #8b5cf6;
    color: white;
}

.finish-btn:hover {
    background: #7c3aed;
}

/* ============================================
   COLOR PICKER
   ============================================ */

.color-picker-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2001;
    padding: 24px;
    min-width: 250px;
    animation: slideInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-picker-content h3 {
    margin: 0 0 16px 0;
    color: #1f2937;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.color-option.yellow { background: linear-gradient(135deg, rgba(255, 235, 59, 0.2), rgba(255, 235, 59, 0.1)); border-color: rgba(255, 235, 59, 0.6); }
.color-option.blue { background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.1)); border-color: rgba(33, 150, 243, 0.6); }
.color-option.green { background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1)); border-color: rgba(76, 175, 80, 0.6); }
.color-option.purple { background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(156, 39, 176, 0.1)); border-color: rgba(156, 39, 176, 0.6); }
.color-option.pink { background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(233, 30, 99, 0.1)); border-color: rgba(233, 30, 99, 0.6); }

body.night-mode .color-option {
    border-color: rgba(255, 255, 255, 0.3);
}

body.night-mode .color-option:hover {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

body.night-mode .color-option.yellow {
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.2), rgba(255, 235, 59, 0.1));
    border-color: rgba(255, 235, 59, 0.4);
}
body.night-mode .color-option.blue {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.1));
    border-color: rgba(33, 150, 243, 0.4);
}
body.night-mode .color-option.green {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    border-color: rgba(76, 175, 80, 0.4);
}
body.night-mode .color-option.purple {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(156, 39, 176, 0.1));
    border-color: rgba(156, 39, 176, 0.4);
}
body.night-mode .color-option.pink {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(233, 30, 99, 0.1));
    border-color: rgba(233, 30, 99, 0.4);
}

/* ============================================
   DARK MODE
   ============================================ */

body.night-mode .streams-page {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

body.night-mode .stat-item {
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-left-color: #60a5fa;
}

body.night-mode .stat-label {
    color: #9ca3af;
}

body.night-mode .stat-value {
    color: #60a5fa;
}

body.night-mode .streams-filter-bar {
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.night-mode .streams-search-input {
    background: #0a0a0a;
    border-color: #374151;
    color: #e5e7eb;
}

body.night-mode .streams-search-input:focus {
    border-color: #60a5fa;
    background: #111827;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

body.night-mode .filter-btn,
body.night-mode .filter-select {
    background: #1a1a1a;
    border-color: #374151;
    color: #e5e7eb;
}

body.night-mode .filter-btn:hover,
body.night-mode .filter-select:hover {
    border-color: #60a5fa;
    color: #60a5fa;
}

body.night-mode .filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

body.night-mode .category-dropdown-menu {
    background: #1a1a1a;
    border-color: #374151;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

body.night-mode .category-dropdown-header {
    border-color: #374151;
    color: #9ca3af;
}

body.night-mode .category-edit-btn {
    color: #60a5fa;
}

body.night-mode .category-edit-btn:hover {
    background: rgba(96, 165, 250, 0.15);
}

body.night-mode .category-dropdown-item {
    color: #e5e7eb;
}

body.night-mode .category-dropdown-item:hover {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

body.night-mode .category-action-btn {
    color: #9ca3af;
}

body.night-mode .category-action-btn:last-child {
    color: #f87171;
}

body.night-mode .stream-block {
    background: #1a1a1a;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    border-bottom-color: #374151;
}

body.night-mode .stream-block:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.night-mode .stream-block-header {
    border-bottom-color: #374151;
}

body.night-mode .verse-reference {
    color: #e5e7eb;
}

body.night-mode .stream-block-content {
    background: transparent;
}

body.night-mode .stream-block .verse-text {
    color: #d1d5db;
}

body.night-mode .stream-block-actions {
    background: #0a0a0a;
    border-top-color: #374151;
}

body.night-mode .action-btn {
    background: #1a1a1a;
    border-color: #374151;
    color: #9ca3af;
}

body.night-mode .action-btn:hover {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.night-mode .memorization-modal {
    background: #1a1a1a;
    color: #e5e7eb;
}

body.night-mode .memorization-header {
    border-bottom-color: #374151;
    background: linear-gradient(135deg, #111827, #0f172a);
}

body.night-mode .memorization-header h2 {
    color: #e5e7eb;
}

body.night-mode .verse-display {
    background: #0a0a0a;
    border-left-color: #60a5fa;
}

body.night-mode .verse-full {
    color: #e5e7eb;
}

body.night-mode .verse-reference {
    color: #9ca3af;
}

body.night-mode .memorization-input,
body.night-mode .memorization-textarea {
    background: #0a0a0a;
    border-color: #374151;
    color: #e5e7eb;
}

body.night-mode .memorization-input:focus,
body.night-mode .memorization-textarea:focus {
    border-color: #60a5fa;
    background: #111827;
}

body.night-mode .input-display {
    background: #0a0a0a;
    border-color: #374151;
    color: #e5e7eb;
}

body.night-mode .level3-display {
    background: #0a0a0a;
    border-color: #374151;
}

body.night-mode .level3-output .word.correct {
    background: #064e3b;
    color: #86efac;
}

body.night-mode .level3-output .word.incorrect {
    background: #7f1d1d;
    color: #fca5a5;
}

body.night-mode .color-picker-modal {
    background: #1a1a1a;
    color: #e5e7eb;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .streams-page {
        padding: 35px 10px 20px 10px;
    }

    .streams-stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-item {
        padding: 10px 12px;
    }

    .stat-label {
        font-size: 0.65em;
    }

    .stat-value {
        font-size: 1.4em;
    }

    .streams-filter-bar {
        flex-direction: column;
        padding: 10px;
        gap: 8px;
        margin-top: 0;
    }

    .streams-search-input {
        width: 100%;
    }

    .streams-filter-buttons {
        width: 100%;
    }

    .filter-select {
        flex: 1;
    }

    .streams-blocks-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stream-block-actions {
        grid-template-columns: repeat(4, 1fr);
        padding: 10px 12px;
        gap: 5px;
    }

    .memorize-btn {
        grid-column: span 2;
        font-size: 0.8em;
        padding: 6px;
    }

    .memorization-modal {
        width: 95%;
        max-height: 95vh;
        margin: 0 auto;
    }

    .memorization-body {
        padding: 16px;
    }

    .verse-full {
        font-size: 1em;
    }

    .color-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .streams-stats-bar {
        grid-template-columns: 1fr;
    }

    .stat-item {
        display: grid;
        grid-template-columns: 1fr 1fr;
        text-align: left;
        gap: 8px;
    }

    .stat-label {
        grid-column: 1;
        grid-row: 1;
    }

    .stat-value {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
    }

    .filter-select {
        font-size: 0.9em;
    }

    .stream-block-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .memorize-btn {
        grid-column: span 1.5;
    }

    .action-btn {
        font-size: 0.75em;
        padding: 6px 4px;
    }
}

/* Stream Block Menu Modal */
.stream-block-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.stream-block-menu-modal {
    width: 100%;
    height: 100%;
}

.stream-block-menu-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    animation: slideInUp 0.3s ease-out;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.menu-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #1f2937;
}

.close-menu-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-section {
    margin-bottom: 20px;
}

.menu-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    font-size: 0.9em;
}

.menu-color-options {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    justify-content: center;
}

.menu-color-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid;
    cursor: pointer;
    position: relative;
}

/* Match Bible app highlight gradient colors */
.menu-color-btn.blue { background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.1)); border-color: rgba(33, 150, 243, 0.6); }
.menu-color-btn.yellow { background: linear-gradient(135deg, rgba(255, 235, 59, 0.2), rgba(255, 235, 59, 0.1)); border-color: rgba(255, 235, 59, 0.6); }
.menu-color-btn.green { background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1)); border-color: rgba(76, 175, 80, 0.6); }
.menu-color-btn.purple { background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(156, 39, 176, 0.1)); border-color: rgba(156, 39, 176, 0.6); }
.menu-color-btn.pink { background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(233, 30, 99, 0.1)); border-color: rgba(233, 30, 99, 0.6); }

.menu-color-btn.active {
    border-color: #1f2937;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #1f2937;
}

.menu-color-btn:active {
    transform: scale(0.95);
}

/* Hover effects only on devices that support hover */
@media (hover: hover) {
    .menu-color-btn {
        transition: all 0.2s ease;
    }

    .menu-color-btn:hover {
        transform: scale(1.1);
    }
}

.menu-delete-btn {
    width: 100%;
    padding: 14px 16px;
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid #fecaca;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95em;
}

.menu-delete-btn:active {
    transform: scale(0.98);
}

/* Hover effects only on devices that support hover */
@media (hover: hover) {
    .menu-delete-btn {
        transition: all 0.2s ease;
    }

    .menu-delete-btn:hover {
        background: #fecaca;
        border-color: #dc2626;
    }
}

.menu-help-btn {
    width: 100%;
    padding: 14px 16px;
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #bfdbfe;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95em;
    margin-bottom: 16px;
}

.menu-help-btn:active {
    transform: scale(0.98);
}

/* Hover effects only on devices that support hover */
@media (hover: hover) {
    .menu-help-btn {
        transition: all 0.2s ease;
    }

    .menu-help-btn:hover {
        background: #bfdbfe;
        border-color: #1e40af;
    }
}

body.night-mode .stream-block-menu-content {
    background: #1f2937;
    color: #f3f4f6;
}

body.night-mode .menu-header h3 {
    color: #f3f4f6;
}

body.night-mode .close-menu-btn {
    color: #9ca3af;
}

body.night-mode .menu-label {
    color: #e5e7eb;
}

body.night-mode .block-category-btn {
    color: #6b7280;
}

body.night-mode .block-category-btn:hover {
    background: #4b5563;
    color: #60a5fa;
}

/* Dark mode for menu color buttons */
body.night-mode .menu-color-btn.blue { background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.1)); border-color: rgba(33, 150, 243, 0.4); }
body.night-mode .menu-color-btn.yellow { background: linear-gradient(135deg, rgba(255, 235, 59, 0.2), rgba(255, 235, 59, 0.1)); border-color: rgba(255, 235, 59, 0.4); }
body.night-mode .menu-color-btn.green { background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1)); border-color: rgba(76, 175, 80, 0.4); }
body.night-mode .menu-color-btn.purple { background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(156, 39, 176, 0.1)); border-color: rgba(156, 39, 176, 0.4); }
body.night-mode .menu-color-btn.pink { background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(233, 30, 99, 0.1)); border-color: rgba(233, 30, 99, 0.4); }

body.night-mode .menu-delete-btn {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
    color: #fca5a5;
}

@media (hover: hover) {
    body.night-mode .menu-delete-btn:hover {
        background: rgba(220, 38, 38, 0.3);
        border-color: rgba(220, 38, 38, 0.7);
    }
}

body.night-mode .menu-help-btn {
    background: rgba(30, 64, 175, 0.2);
    border-color: rgba(30, 64, 175, 0.5);
    color: #93c5fd;
}

@media (hover: hover) {
    body.night-mode .menu-help-btn:hover {
        background: rgba(30, 64, 175, 0.3);
        border-color: rgba(30, 64, 175, 0.7);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .stream-block-menu-content {
        max-height: 70vh;
    }

    .menu-color-btn {
        width: 44px;
        height: 44px;
    }
}

/* Stream Block Stats Display */
.stream-block-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 28px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.stat-level {
    color: #374151;
    font-size: 0.85em;
}

.stat-percentage {
    background: rgba(37, 99, 235, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    color: #1f2937;
    min-width: 40px;
    text-align: center;
}

.stat-days {
    font-size: 0.75em;
    color: #6b7280;
}

.stat-new {
    color: #6b7280;
    font-size: 0.85em;
    font-weight: 600;
}

body.night-mode .stream-block-stats {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.night-mode .stat-badge {
    background: rgba(255, 255, 255, 0.15);
}

body.night-mode .stat-level {
    color: rgba(255, 255, 255, 0.95);
}

body.night-mode .stat-percentage {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

body.night-mode .stat-days {
    color: rgba(255, 255, 255, 0.7);
}

body.night-mode .stat-new {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .stream-block-stats {
        margin-top: 10px;
        padding-top: 10px;
    }

    .stat-badge {
        padding: 5px 10px;
        gap: 6px;
    }

    .stat-level {
        font-size: 0.8em;
    }

    .stat-percentage {
        font-size: 0.75em;
        padding: 2px 6px;
    }
}

/* ============================================
   MEMORY STATS MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.memory-stats-modal {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 92%;
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.stats-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-header h2::before {
    content: "📊";
    font-size: 1.2em;
}

/* Memory stats modal close button - more specific to override global .close-btn */
.memory-stats-modal .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 28px;
    font-weight: normal;
    cursor: pointer;
    color: white !important;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.memory-stats-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white !important;
    transform: scale(1.05);
}

.stats-content {
    padding: 24px;
    background: #f9fafb;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: white;
    padding: 16px 12px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.stat-card .stat-value {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 0.75em;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.3;
}

.stats-footer {
    text-align: center;
    padding: 16px 24px 20px;
    background: white;
}

.stats-footer p {
    margin: 0;
    font-size: 0.9em;
    color: #6b7280;
}

.stats-footer p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95em;
}

body.night-mode .memory-stats-modal {
    background: #1f2937;
}

body.night-mode .stats-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

body.night-mode .stats-content {
    background: #111827;
}

body.night-mode .stat-card {
    background: #1f2937;
    border-color: #374151;
}

body.night-mode .stat-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

body.night-mode .stat-card .stat-value {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.night-mode .stat-card .stat-label {
    color: #9ca3af;
}

body.night-mode .stats-footer {
    background: #1f2937;
}

body.night-mode .stats-footer p {
    color: #9ca3af;
}

body.night-mode .memory-stats-modal .close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

body.night-mode .memory-stats-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
}

@media (max-width: 768px) {
    .memory-stats-modal {
        width: 95%;
        max-width: 400px;
    }

    .stats-header h2 {
        font-size: 1.2em;
    }

    .stats-content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-card .stat-value {
        font-size: 1.8em;
    }

    .stat-card .stat-label {
        font-size: 0.7em;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 2em;
    }

    .stat-label {
        font-size: 0.85em;
    }
}

/* ============================================
   CATEGORY MODALS
   ============================================ */

.category-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease;
}

.category-modal-overlay.active {
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

.category-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.category-modal-overlay.active .category-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.category-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #f3f4f6;
    background: linear-gradient(135deg, #f0f9ff, #f5f3ff);
}

.category-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #1f2937;
    font-weight: 600;
}

.category-modal-header .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.category-modal-header .close-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.category-modal-content {
    padding: 24px;
}

.category-create-new-btn {
    width: 100%;
    padding: 14px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    margin-bottom: 16px;
}

.category-divider {
    margin: 0 0 12px 0;
    font-size: 0.8em;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    text-transform: lowercase;
}

.category-list-scrollable {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 2px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item {
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95em;
    cursor: pointer;
    color: #1f2937;
    text-align: left;
}

.category-manage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
}

.category-manage-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.category-manage-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 1em;
}

.category-edit-input {
    font-weight: 500;
    color: #1f2937;
    font-size: 1em;
    padding: 4px 8px;
    border: 2px solid #2563eb;
    border-radius: 6px;
    outline: none;
    background: white;
    width: 100%;
    max-width: 300px;
}

.category-manage-count {
    font-size: 0.85em;
    color: #6b7280;
}

.category-manage-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.category-action-icon-btn {
    padding: 6px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    color: #6b7280;
}

.category-action-icon-btn.delete-btn {
    color: #ef4444;
    font-weight: bold;
    font-size: 1.3em;
}

.category-action-icon-btn.save-btn {
    color: #10b981;
    font-size: 1.2em;
}

.category-action-icon-btn.cancel-btn {
    color: #6b7280;
    font-size: 1.2em;
}

.category-action-icon-btn:active {
    transform: scale(0.95);
}

.category-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.2s ease;
}

.category-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #f0f9ff;
}

.category-create-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-create-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.category-create-btn:active {
    transform: translateY(0);
}

/* Menu header flex layout for question mark icon */
.menu-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-help-icon {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #1e40af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.menu-help-icon:hover {
    background: #dbeafe;
    color: #1d4ed8;
    transform: scale(1.1);
}

.menu-category-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-category-btn {
    width: 100%;
    padding: 12px 16px;
    background: #f0f9ff;
    color: #2563eb;
    border: 2px solid #bfdbfe;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.menu-category-btn:hover {
    background: #e0f2fe;
    border-color: #2563eb;
    transform: translateX(4px);
}

.menu-category-btn:active {
    transform: translateX(2px);
}

/* Dark mode for category modals */
body.night-mode .category-modal {
    background: #1f2937;
    color: #f3f4f6;
}

body.night-mode .category-modal-header {
    background: linear-gradient(135deg, #111827, #0f172a);
    border-bottom-color: #4b5563;
}

body.night-mode .category-modal-header h3 {
    color: #f3f4f6;
}

body.night-mode .category-modal-header .close-btn {
    color: #9ca3af;
}

body.night-mode .category-modal-header .close-btn:hover {
    background: #4b5563;
    color: #f3f4f6;
}

body.night-mode .category-divider {
    color: #9ca3af;
}

body.night-mode .category-create-new-btn {
    background: #2563eb;
}

body.night-mode .category-item {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.night-mode .category-input {
    background: #0a0a0a;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.night-mode .category-input:focus {
    border-color: #60a5fa;
    background: #111827;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

body.night-mode .category-manage-item {
    background: #1f2937;
    border-color: #374151;
}

body.night-mode .category-manage-name {
    color: #e5e7eb;
}

body.night-mode .category-edit-input {
    background: #111827;
    border-color: #60a5fa;
    color: #e5e7eb;
}

body.night-mode .category-manage-count {
    color: #9ca3af;
}

body.night-mode .category-action-icon-btn {
    color: #9ca3af;
}

body.night-mode .category-action-icon-btn.delete-btn {
    color: #f87171;
}

body.night-mode .category-action-icon-btn.save-btn {
    color: #34d399;
}

body.night-mode .menu-help-icon {
    color: #93c5fd;
}

body.night-mode .menu-help-icon:hover {
    background: rgba(30, 64, 175, 0.3);
    color: #60a5fa;
}

body.night-mode .menu-category-btn {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
    border-color: rgba(37, 99, 235, 0.5);
}

body.night-mode .menu-category-btn:hover {
    background: rgba(37, 99, 235, 0.3);
    border-color: #60a5fa;
    color: #60a5fa;
}

@media (max-width: 768px) {
    .category-modal {
        width: 95%;
        max-height: 85vh;
    }

    .category-modal-header {
        padding: 16px;
    }

    .category-modal-header h3 {
        font-size: 1.1em;
    }

    .category-modal-content {
        padding: 16px;
    }

    .category-input-group {
        flex-direction: column;
    }

    .category-create-btn {
        width: 100%;
    }
}

/* ============================================
   FILTER MODALS - Professional Styling
   ============================================ */

.filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.filter-modal-overlay.active {
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

.filter-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.filter-modal-overlay.active .filter-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #f3f4f6;
    background: linear-gradient(135deg, #f0f9ff, #f5f3ff);
    flex-shrink: 0;
}

.filter-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #1f2937;
    font-weight: 600;
}

.mem-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

@media (hover: hover) {
    .mem-close-btn {
        transition: all 0.2s ease;
    }

    .mem-close-btn:hover {
        background: #e5e7eb;
        color: #1f2937;
    }
}

.filter-modal-content {
    padding: 12px 0;
    overflow-y: auto;
    flex: 1;
}

.filter-modal-option {
    width: 100%;
    padding: 14px 24px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1em;
    color: #1f2937;
    font-weight: 500;
    position: relative;
}

@media (hover: hover) {
    .filter-modal-option {
        transition: all 0.2s ease;
    }

    .filter-modal-option:hover {
        background: rgba(37, 99, 235, 0.08);
        color: #2563eb;
    }
}

.filter-modal-option.active {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-weight: 600;
}

.filter-color-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.filter-color-circle.yellow {
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.2), rgba(255, 235, 59, 0.1));
    border-color: rgba(255, 235, 59, 0.6);
}

.filter-color-circle.blue {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.1));
    border-color: rgba(33, 150, 243, 0.6);
}

.filter-color-circle.green {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    border-color: rgba(76, 175, 80, 0.6);
}

.filter-color-circle.purple {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(156, 39, 176, 0.1));
    border-color: rgba(156, 39, 176, 0.6);
}

.filter-color-circle.pink {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(233, 30, 99, 0.1));
    border-color: rgba(233, 30, 99, 0.6);
}

.filter-check {
    margin-left: auto;
    color: #2563eb;
    font-size: 1.2em;
    font-weight: bold;
}

.filter-modal-footer {
    padding: 16px 24px;
    border-top: 2px solid #f3f4f6;
    flex-shrink: 0;
}

.filter-modal-manage-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
}

@media (hover: hover) {
    .filter-modal-manage-btn {
        transition: all 0.2s ease;
    }

    .filter-modal-manage-btn:hover {
        background: linear-gradient(135deg, #1d4ed8, #1e40af);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
}

.filter-modal-manage-btn:active {
    transform: translateY(1px);
}

/* Dark mode for filter modals */
body.night-mode .filter-modal {
    background: #1f2937;
    color: #f3f4f6;
}

body.night-mode .filter-modal-header {
    background: linear-gradient(135deg, #111827, #0f172a);
    border-bottom-color: #4b5563;
}

body.night-mode .filter-modal-header h3 {
    color: #f3f4f6;
}

body.night-mode .mem-close-btn {
    color: #9ca3af;
}

@media (hover: hover) {
    body.night-mode .mem-close-btn:hover {
        background: #4b5563;
        color: #f3f4f6;
    }
}

body.night-mode .filter-modal-option {
    color: #e5e7eb;
}

@media (hover: hover) {
    body.night-mode .filter-modal-option:hover {
        background: rgba(96, 165, 250, 0.15);
        color: #60a5fa;
    }
}

body.night-mode .filter-modal-option.active {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

body.night-mode .filter-color-circle.yellow {
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.2), rgba(255, 235, 59, 0.1));
    border-color: rgba(255, 235, 59, 0.4);
}

body.night-mode .filter-color-circle.blue {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.1));
    border-color: rgba(33, 150, 243, 0.4);
}

body.night-mode .filter-color-circle.green {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    border-color: rgba(76, 175, 80, 0.4);
}

body.night-mode .filter-color-circle.purple {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(156, 39, 176, 0.1));
    border-color: rgba(156, 39, 176, 0.4);
}

body.night-mode .filter-color-circle.pink {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(233, 30, 99, 0.1));
    border-color: rgba(233, 30, 99, 0.4);
}

body.night-mode .filter-check {
    color: #60a5fa;
}

body.night-mode .filter-modal-footer {
    border-top-color: #4b5563;
}

/* Category filter with inline edit/delete */
.filter-modal-wide {
    max-width: 500px;
}

.filter-category-item {
    width: 100%;
    padding: 14px 24px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 1em;
    color: #1f2937;
    font-weight: 500;
    position: relative;
}

@media (hover: hover) {
    .filter-category-item {
        transition: all 0.2s ease;
    }

    .filter-category-item:hover {
        background: rgba(37, 99, 235, 0.08);
        color: #2563eb;
    }
}

.filter-category-item.active {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-weight: 600;
}

.filter-category-name {
    flex: 1;
    cursor: pointer;
}

.filter-category-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-category-edit-btn,
.filter-category-delete-btn,
.filter-category-save-btn,
.filter-category-cancel-btn {
    background: none;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

@media (hover: hover) {
    .filter-category-edit-btn,
    .filter-category-delete-btn,
    .filter-category-save-btn,
    .filter-category-cancel-btn {
        transition: all 0.2s ease;
    }
}

.filter-category-edit-btn {
    color: #2563eb;
}

@media (hover: hover) {
    .filter-category-edit-btn:hover {
        background: rgba(37, 99, 235, 0.15);
    }
}

.filter-category-delete-btn {
    color: #ef4444;
    font-size: 1.5em;
    font-weight: bold;
    line-height: 1;
}

@media (hover: hover) {
    .filter-category-delete-btn:hover {
        background: rgba(239, 68, 68, 0.15);
    }
}

.filter-category-save-btn {
    color: #22c55e;
    font-size: 1.3em;
    font-weight: bold;
}

@media (hover: hover) {
    .filter-category-save-btn:hover {
        background: rgba(34, 197, 94, 0.15);
    }
}

.filter-category-cancel-btn {
    color: #6b7280;
    font-size: 1.3em;
    font-weight: bold;
}

@media (hover: hover) {
    .filter-category-cancel-btn:hover {
        background: rgba(107, 114, 128, 0.15);
    }
}

.filter-category-edit-input {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #2563eb;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    outline: none;
    background: white;
}

/* Dark mode for category filter */
body.night-mode .filter-category-item {
    color: #e5e7eb;
}

@media (hover: hover) {
    body.night-mode .filter-category-item:hover {
        background: rgba(96, 165, 250, 0.15);
        color: #60a5fa;
    }
}

body.night-mode .filter-category-item.active {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

body.night-mode .filter-category-edit-btn {
    color: #60a5fa;
}

body.night-mode .filter-category-delete-btn {
    color: #f87171;
}

body.night-mode .filter-category-save-btn {
    color: #4ade80;
}

body.night-mode .filter-category-cancel-btn {
    color: #9ca3af;
}

body.night-mode .filter-category-edit-input {
    background: #111827;
    border-color: #60a5fa;
    color: #e5e7eb;
}

@media (max-width: 768px) {
    .filter-modal {
        width: 95%;
        max-height: 75vh;
    }

    .filter-modal-wide {
        max-width: 95%;
    }

    .filter-modal-header {
        padding: 16px 20px;
    }

    .filter-modal-header h3 {
        font-size: 1.1em;
    }

    .filter-modal-option {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .filter-category-item {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .filter-color-circle {
        width: 24px;
        height: 24px;
    }

    .filter-modal-footer {
        padding: 14px 20px;
    }

    .filter-modal-manage-btn {
        padding: 10px 14px;
        font-size: 0.9em;
    }

    .filter-category-edit-btn,
    .filter-category-delete-btn,
    .filter-category-save-btn,
    .filter-category-cancel-btn {
        font-size: 1em;
    }
}
