/**
 * Material Design News Aggregator Styles
 * Professional, Modern, Beautiful Visual Design
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    --primary-color: #1f4ebd;
    --primary-dark: #183e99;
    --primary-light: #d7e3fb;
    --secondary-color: #0f7abf;
    --accent-color: #22863a;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --divider: #e5e7eb;
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --surface: #ffffff;
    --error: #d11a2a;
    --success: #22863a;
    --warning: #f59e0b;
    --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-2: 0 2px 6px rgba(15, 23, 42, 0.12);
    --shadow-3: 0 6px 16px rgba(15, 23, 42, 0.14);
    --shadow-4: 0 12px 24px rgba(15, 23, 42, 0.18);
    --gradient-primary: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-color) 100%);
    --gradient-secondary: linear-gradient(180deg, var(--secondary-color) 0%, var(--secondary-color) 100%);
    --gradient-success: linear-gradient(180deg, var(--success) 0%, var(--success) 100%);
    --top-nav-bg: #1e2a3b;
    --top-nav-text: #ffffff;
    --top-nav-subtext: rgba(255, 255, 255, 0.85);
}

body {
    font-family: 'Heebo', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: #f5f7fa;
    padding: 0;
    margin: 0;
    direction: rtl;
    font-size: clamp(15px, 2vw, 16px);
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
    /* App-like feel */
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

body.dark-mode {
    --text-primary: #E0E0E0;
    --text-secondary: #B0B0B0;
    --bg-primary: #121212;
    --bg-secondary: #1E1E1E;
    --surface: #1E1E1E;
    --divider: #333333;
    --primary-color: #64B5F6;
    --primary-dark: #42A5F5;
    --primary-light: #90CAF9;
    --top-nav-bg: #111827;
    --top-nav-text: #f8fafc;
    --top-nav-subtext: rgba(226, 232, 240, 0.78);
    background: #121212 !important;
    color: #E0E0E0 !important;
}

body.dark-mode .top-nav {
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    --nav-btn-bg: rgba(148, 163, 184, 0.18);
    --nav-btn-border: rgba(148, 163, 184, 0.35);
    --nav-btn-color: #f8fafc;
    --nav-btn-bg-hover: rgba(96, 165, 250, 0.42);
    --nav-btn-border-hover: rgba(96, 165, 250, 0.55);
    --nav-btn-bg-active: rgba(59, 130, 246, 0.65);
    --nav-btn-bg-active-state: rgba(37, 99, 235, 0.75);
    --nav-btn-border-active-state: rgba(59, 130, 246, 0.6);
    --nav-info-bg: rgba(30, 41, 59, 0.8);
    --nav-info-color: #e2e8f0;
}

body.dark-mode .news-item {
    background: #1E1E1E;
    border: 1px solid #333333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .news-item:hover {
    background: #252525;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.2);
}

body.dark-mode .source-filters,
body.dark-mode .material-card {
    background: #1E1E1E;
    border: 1px solid #333333;
}

body.dark-mode .currency-panel,
body.dark-mode .side-menu,
body.dark-mode .custom-sources-panel,
body.dark-mode .settings-panel,
body.dark-mode .bi-panel {
    background: #1E1E1E;
    border: 1px solid #333333;
}

body.dark-mode .notification {
    background: #1E1E1E;
    border: 1px solid #333333;
    color: #E0E0E0;
}

body.dark-mode .read-more {
    background: var(--primary-color);
    color: #121212;
}

body.dark-mode .read-more:hover {
    background: var(--primary-dark);
    color: white;
}

body.dark-mode .checkbox-label,
body.dark-mode .add-comment input,
body.dark-mode .currency-select,
body.dark-mode .setting-item select,
body.dark-mode .setting-item input {
    background: #252525;
    border-color: #404040;
    color: #E0E0E0;
}

body.dark-mode .checkbox-label:hover {
    background: #2a2a2a;
    border-color: var(--primary-color);
}

body.dark-mode .top-nav .material-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .top-nav .material-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .top-nav .notification-dot {
    border-color: #1E1E1E;
}

body.dark-mode .news-title a {
    color: #E0E0E0;
}

body.dark-mode .news-title a:hover {
    color: var(--primary-color);
}

body.dark-mode .news-description {
    color: #B0B0B0;
}

body.dark-mode .news-source {
    color: var(--primary-color);
    background: rgba(100, 181, 246, 0.1);
}

body.dark-mode .news-date {
    color: #888888;
}

body.high-contrast {
    --text-primary: #000000;
    --text-secondary: #000000;
    --bg-primary: #FFFFFF;
    --bg-secondary: #FFFFFF;
    --surface: #FFFFFF;
    --divider: #000000;
    --primary-color: #0000FF;
    --primary-dark: #0000CC;
    --primary-light: #E0E0FF;
    background: #FFFFFF !important;
    color: #000000 !important;
}

body.high-contrast .news-item,
body.high-contrast .material-card,
body.high-contrast .source-filters {
    border: 3px solid #000000 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
}

body.high-contrast .news-title a,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3 {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

body.high-contrast .top-nav {
    background: #000000 !important;
    color: #FFFFFF !important;
    border-bottom: 3px solid #FFFFFF;
}

body.high-contrast .material-btn,
body.high-contrast .action-btn {
    border: 2px solid #000000 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
}

body.high-contrast .material-btn:hover,
body.high-contrast .action-btn:hover {
    background: #000000 !important;
    color: #FFFFFF !important;
}

body.high-contrast .read-more {
    background: #000000 !important;
    color: #FFFFFF !important;
    border: 2px solid #000000 !important;
}

body.high-contrast .notification {
    border: 3px solid #000000 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
}

/* Material Design Top Navigation - App-like */
.top-nav {
    background: var(--top-nav-bg);
    color: var(--top-nav-text);
    padding: 14px 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    min-height: 70px;
    padding-top: calc(10px + env(safe-area-inset-top, 0));
    --nav-btn-bg: rgba(15, 23, 42, 0.18);
    --nav-btn-border: rgba(148, 163, 184, 0.32);
    --nav-btn-color: #f8fafc;
    --nav-btn-bg-hover: rgba(30, 64, 175, 0.55);
    --nav-btn-border-hover: rgba(59, 130, 246, 0.45);
    --nav-btn-bg-active: rgba(37, 99, 235, 0.7);
    --nav-btn-bg-active-state: rgba(37, 99, 235, 0.85);
    --nav-btn-border-active-state: rgba(59, 130, 246, 0.65);
    --nav-info-bg: rgba(15, 23, 42, 0.65);
    --nav-info-color: #e2e8f0;
    flex-wrap: wrap;
}

.nav-left {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    order: 1;
    flex: 0 1 auto;
    flex-shrink: 1;
    max-width: 65%;
    --toggle-bg: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
    .nav-left {
        gap: 4px;
    }
    
    .nav-left .material-btn,
    .nav-right .material-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9em;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .nav-left {
        gap: 3px;
    }
    
    .nav-left .material-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8em;
    }
}

@media (max-width: 640px) {
    .top-nav {
        padding: 12px 16px calc(12px + env(safe-area-inset-top, 0));
        gap: 10px;
        justify-content: flex-start;
        flex-direction: column;
        align-items: stretch;
        background: linear-gradient(145deg, #111827, #1e293b);
        border-bottom: 1px solid rgba(15, 23, 42, 0.28);
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
        --nav-btn-bg: rgba(148, 163, 184, 0.24);
        --nav-btn-border: rgba(148, 163, 184, 0.42);
        --nav-btn-color: #f8fafc;
        --nav-btn-bg-hover: rgba(59, 130, 246, 0.55);
        --nav-btn-border-hover: rgba(59, 130, 246, 0.65);
        --nav-btn-bg-active: rgba(37, 99, 235, 0.7);
        --nav-btn-bg-active-state: rgba(37, 99, 235, 0.82);
        --nav-btn-border-active-state: rgba(37, 99, 235, 0.72);
        --nav-info-bg: rgba(15, 23, 42, 0.55);
        --nav-info-color: #e2e8f0;
    }

    .nav-left,
    .nav-right,
    .nav-center {
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }

    .nav-left,
    .nav-right {
        justify-content: space-between;
        gap: 4px;
        margin: 0;
    }

    .nav-left {
        order: 1;
        flex-wrap: wrap;
    }

    .nav-right {
        order: 3;
        justify-content: center;
        margin-top: 6px;
    }

    .nav-center {
        order: 2;
        margin: 4px 0 6px;
        text-align: center;
    }

    .nav-quick-actions.open {
        width: 100%;
        margin-top: 6px;
        padding: 6px;
        border-radius: 12px;
        background: rgba(15, 23, 42, 0.32);
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    }

    .refresh-info {
        align-self: stretch;
        width: 100%;
        justify-content: center;
        text-align: center;
        background: var(--nav-info-bg);
        color: var(--nav-info-color);
    }

    .material-btn {
        background: rgba(31, 78, 189, 0.12);
        border: 1px solid rgba(31, 78, 189, 0.24);
        color: var(--primary-dark);
    }

    .material-btn:hover {
        background: rgba(31, 78, 189, 0.18);
        border-color: rgba(31, 78, 189, 0.32);
    }

    .material-btn.is-active {
        background: rgba(31, 78, 189, 0.24);
        border-color: rgba(31, 78, 189, 0.4);
    }

    .top-nav .material-btn {
        background: var(--nav-btn-bg);
        border-color: var(--nav-btn-border);
        color: var(--nav-btn-color);
        box-shadow: none;
    }

    .top-nav .material-btn:hover {
        background: var(--nav-btn-bg-hover);
        border-color: var(--nav-btn-border-hover);
    }

    .top-nav .material-btn.is-active {
        background: var(--nav-btn-bg-active-state);
        border-color: var(--nav-btn-border-active-state);
    }
}

.nav-right {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    position: relative;
    z-index: 1;
    order: 3;
    margin-left: auto;
    flex: 0 0 auto;
}

.nav-right .refresh-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75em;
    opacity: 0.9;
    white-space: nowrap;
    color: var(--top-nav-subtext);
    /* Always visible in top right corner */
}

@media (max-width: 768px) {
    .nav-right .refresh-info {
        font-size: 0.7em;
        gap: 4px;
    }
    
    .nav-right .refresh-info i {
        font-size: 0.8em;
    }
}

.nav-center {
    flex: 1 1 220px;
    min-width: 0;
    text-align: center;
    overflow: hidden;
    order: 2;
    padding: 0 8px;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.nav-center h1 {
    font-size: 1.35em;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--top-nav-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nav-center .subtitle {
    font-size: 0.72em;
    opacity: 0.85;
    margin-top: 2px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--top-nav-subtext);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 768px) {
    .nav-center h1 {
        font-size: 1.2em;
    }
    
    .nav-center .subtitle {
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .nav-center {
        order: 3;
        margin: 0;
        width: 100%;
        flex-basis: 100%;
    }

    .nav-center h1 {
        font-size: clamp(1rem, 3.4vw, 1.2rem);
    }

    .nav-center .subtitle {
        font-size: clamp(0.55rem, 2.4vw, 0.7rem);
    }
}

.material-btn {
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 1rem;
    flex-shrink: 0;
}

.material-btn:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.material-btn:active {
    background: rgba(37, 99, 235, 0.28);
}

.material-btn.is-active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(59, 130, 246, 0.28));
    border-color: rgba(59, 130, 246, 0.4);
}

body.dark-mode .material-btn {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.28);
    color: #f8fafc;
}

body.dark-mode .material-btn:hover {
    background: rgba(148, 163, 184, 0.28);
}

body.dark-mode .material-btn:active {
    background: rgba(148, 163, 184, 0.35);
}

body.dark-mode .material-btn.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(129, 140, 248, 0.3));
    border-color: rgba(129, 140, 248, 0.45);
}

.material-btn i {
    color: inherit;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-nav .material-btn {
    background: var(--nav-btn-bg);
    border: 1px solid var(--nav-btn-border);
    color: var(--nav-btn-color);
}

.top-nav .material-btn:hover {
    background: var(--nav-btn-bg-hover);
    border-color: var(--nav-btn-border-hover);
}

.top-nav .material-btn:active {
    background: var(--nav-btn-bg-active);
}

.top-nav .material-btn.is-active {
    background: var(--nav-btn-bg-active-state);
    border-color: var(--nav-btn-border-active-state);
}

.material-btn i {
    color: currentColor;
}

.refresh-info {
    font-size: 0.75em;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--nav-info-bg);
    padding: 4px 10px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    color: var(--nav-info-color);
    white-space: nowrap;
}

.refresh-info i {
    font-size: 0.9em;
    /* No rotation, small icon */
    transition: none;
}

.refresh-info:hover i {
    /* No rotation on hover */
    transform: none;
}

/* Material Cards - Enhanced */
.material-card {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-2);
    border: 1px solid var(--divider);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.material-card:hover {
    box-shadow: var(--shadow-3);
    border-color: rgba(37, 99, 235, 0.2);
}

/* Currency Panel - App-like */
.currency-panel {
    position: fixed;
    top: 70px;
    right: 0;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 70px);
    background: var(--surface);
    border-radius: 20px 0 0 20px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    padding: 24px;
    z-index: 999;
    display: none;
    overflow-y: auto;
    direction: ltr;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    /* App-like side panel */
}

@media (max-width: 720px) {
    .currency-panel {
        top: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: none;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        padding: calc(20px + env(safe-area-inset-top, 0)) 18px calc(24px + env(safe-area-inset-bottom, 0));
        box-shadow: none;
        border-top: 1px solid rgba(15, 23, 42, 0.12);
    }
}

@media (min-width: 768px) {
    .currency-panel {
        right: 20px;
        top: 80px;
        border-radius: 20px;
        width: 90%;
        max-width: 450px;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.currency-panel.active {
    display: block;
}

.currency-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--divider);
    position: relative;
}

.currency-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.currency-header h3 {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1.4em;
}

.close-btn {
    background: var(--bg-primary);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    box-shadow: var(--shadow-1);
    position: absolute;
    top: 16px;
    right: 20px;
}

.close-btn:hover {
    background: rgba(209, 26, 42, 0.12);
    color: var(--error);
}

/* Currency Controls - Enhanced */
.currency-controls {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--divider);
}

.add-currency-section {
    margin-bottom: 24px;
}

.add-currency-section label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1em;
}

.add-currency-section label i {
    color: var(--primary-color);
    margin-left: 8px;
    font-size: 1.1em;
}

.currency-select-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.currency-select {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--divider);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.currency-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: white;
}

.add-currency-btn {
    padding: 12px 22px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    box-shadow: var(--shadow-1);
    font-weight: 600;
}

.add-currency-btn:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-2);
}

@media (max-width: 640px) {
    .currency-controls {
        padding-bottom: 18px;
    }

    .currency-select-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .add-currency-btn {
        width: 100%;
        min-width: 0;
        padding: 12px;
        font-size: 0.95em;
    }

    .selected-currencies-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .clear-all-btn {
        width: 100%;
        justify-content: center;
    }

    .currency-chart {
        height: 220px;
        margin: 22px 0;
        padding: 12px;
    }
}

.selected-currencies {
    margin-top: 20px;
}

.selected-currencies-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.selected-currencies-header span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1em;
}

.clear-all-btn {
    background: var(--error);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    box-shadow: var(--shadow-1);
}

.clear-all-btn:hover {
    background: #b91c1c;
    box-shadow: var(--shadow-2);
}

.currency-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.currency-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-dark);
    border-radius: 18px;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.2s ease, border-color 0.2s ease;
    box-shadow: none;
    border: 1px solid transparent;
}

.currency-tag:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.35);
}

.remove-currency-btn {
    background: transparent;
    border: none;
    color: var(--primary-dark);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
    width: 20px;
    height: 20px;
    font-size: 0.8em;
}

.remove-currency-btn:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-dark);
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.rate-item {
    padding: 18px;
    background: var(--surface);
    border-radius: 12px;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--divider);
    box-shadow: var(--shadow-1);
}

.rate-item:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: var(--shadow-2);
}

.currency-symbol {
    font-weight: 700;
    display: block;
    font-size: 1.2em;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.currency-rate {
    display: block;
    font-size: 2em;
    color: var(--primary-dark);
    margin: 12px 0;
    font-weight: 700;
    font-family: 'Roboto', monospace;
}

.currency-change {
    font-size: 0.95em;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    display: inline-block;
}

.currency-chart {
    height: 280px;
    margin: 28px 0;
    background: var(--surface);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--divider);
}

.currency-advice {
    margin-top: 24px;
}

.advice-item {
    padding: 16px;
    margin: 10px 0;
    background: var(--surface);
    border-radius: 10px;
    font-size: 0.95em;
    border-right: 3px solid var(--primary-color);
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.advice-item:hover {
    border-right-color: var(--primary-dark);
    box-shadow: var(--shadow-2);
}

/* Source Filters - App-like Collapsible */
.source-filters {
    background: var(--surface);
    padding: 0;
    margin: 16px;
    border-radius: 12px;
    border: 1px solid var(--divider);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.filter-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--bg-primary);
    transition: background 0.2s;
    /* Compact header */
}

.filter-header:hover {
    background: rgba(37, 99, 235, 0.06);
}

.filter-header h3 {
    margin: 0;
    font-size: 1em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.filter-header i {
    transition: transform 0.3s;
}

.filter-header.active i {
    transform: rotate(180deg);
}

.filter-content {
    padding: 16px;
    animation: slideDown 0.3s ease-out;
    /* Compact padding */
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

@media (min-width: 768px) {
    .source-filters {
        padding: 24px;
        margin: 24px;
        border-radius: 20px;
    }
}

.source-filters h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.4em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 16px;
    background: #ffffff;
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--divider);
    font-size: 0.95em;
    font-weight: 500;
}

.checkbox-label:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: var(--shadow-1);
}

.checkbox-label:has(input:checked) {
    border-color: rgba(31, 78, 189, 0.45);
    background: rgba(31, 78, 189, 0.12);
    box-shadow: var(--shadow-1);
}

.checkbox-label:has(input:checked) .checkbox-text {
    color: var(--primary-dark);
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-actions button {
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    box-shadow: var(--shadow-2);
    font-size: 0.95em;
}

.filter-actions button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-3);
}

.filter-actions button:active {
    transform: translateY(0) scale(0.98);
}

.filter-actions .filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    flex: 1;
    min-width: 80px;
}

.filter-actions .filter-btn:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--primary-dark);
}

.filter-actions .filter-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.filter-actions .filter-btn.primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-1);
}

/* News Container - App-like */
.news-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 24px 120px;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 24px 10px;
}

.category-pill,
.category-filters button {
    border: none;
    background: rgba(31, 78, 189, 0.08);
    color: var(--primary-dark);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    white-space: nowrap;
}

.category-pill.active,
.category-filters button.active {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: var(--shadow-2);
}

body.dark-mode .category-filters button {
    background: rgba(100, 181, 246, 0.16);
    color: #cbd5f5;
}

body.dark-mode .category-filters button.active {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
}

.category-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-label i {
    font-size: 0.9em;
}

.category-count {
    background: rgba(31, 78, 189, 0.18);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-inline-start: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
}

body.dark-mode .category-count {
    background: rgba(100, 181, 246, 0.25);
    color: #e2e8f0;
}

.category-pill.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.news-utility-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin: 10px 24px 6px;
}

.utility-btn {
    border: none;
    background: rgba(31, 78, 189, 0.12);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.utility-btn:hover {
    background: rgba(31, 78, 189, 0.18);
    box-shadow: var(--shadow-2);
}

body.dark-mode .utility-btn {
    background: rgba(148, 163, 184, 0.18);
    color: #f8fafc;
}

body.dark-mode .utility-btn:hover {
    background: rgba(148, 163, 184, 0.26);
}

.news-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    margin: 0 24px 18px;
    background: var(--bg-primary);
    border-radius: 18px;
    border: 1px dashed rgba(31, 78, 189, 0.25);
    color: var(--text-secondary);
    gap: 12px;
}

.news-empty-state i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

body.dark-mode .news-empty-state {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.35);
    color: #cbd5f5;
}

body.dark-mode .news-empty-state i {
    color: #60a5fa;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}

.news-tag {
    background: rgba(31, 78, 189, 0.1);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

body.dark-mode .news-tag {
    background: rgba(100, 181, 246, 0.16);
    color: #dbeafe;
}

.news-item.auto-focus {
    box-shadow: 0 12px 32px rgba(31, 78, 189, 0.22);
    border: 2px solid rgba(31, 78, 189, 0.4);
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    .news-container {
        display: grid;
        padding: 20px;
        gap: 20px;
    }
}

@media (min-width: 768px) {
    .news-container {
        max-width: 1200px;
        padding: 24px;
        gap: 20px;
        display: grid;
    }
}

@media (max-width: 768px) {
    .news-container {
        padding: 0 16px 110px;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .news-container {
        padding: 0 14px 110px;
        gap: 12px;
    }

    .news-item {
        padding: 14px;
        border-radius: 16px;
    }

    .news-title a {
        font-size: 1.25em;
    }

    .news-actions {
        width: 100%;
        justify-content: space-between;
    }

    .action-btn {
        width: 36px;
        height: 36px;
    }

    .category-filters {
        margin: 16px 12px 6px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .category-filters::-webkit-scrollbar {
        height: 4px;
    }

    .news-utility-bar {
        margin: 8px 12px;
        justify-content: flex-start;
    }

    .utility-btn {
        width: 100%;
        justify-content: center;
    }

    .news-empty-state {
        margin: 0 12px 14px;
    }
}

@media (max-width: 480px) {
    .news-container {
        padding: 0 10px 110px;
        gap: 10px;
    }

    .news-item {
        padding: 12px;
        border-radius: 14px;
    }

    .news-title a {
        font-size: 1.1em;
    }

    .news-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .category-filters {
        margin: 14px 10px 6px;
    }

    .checkbox-group {
        flex-direction: column;
    }

    .rates-grid {
        grid-template-columns: 1fr;
    }

    .accessibility-panel {
        bottom: 20px;
        left: 20px;
    }
}

@media (max-width: 360px) {
    .news-container {
        padding: 0 8px 110px;
        gap: 8px;
    }

    .news-item {
        padding: 10px;
        border-radius: 12px;
    }

    .news-item h2 {
        font-size: clamp(1rem, 4.4vw, 1.1rem);
    }

    .news-item p {
        font-size: clamp(0.75rem, 3.6vw, 0.85rem);
    }
}

.news-item {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--divider);
    box-shadow: var(--shadow-1);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: move;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .news-item {
        padding: 24px;
        border-radius: 20px;
        margin-bottom: 0;
    }
}

.news-item:hover {
    background: #f9fafb;
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: var(--shadow-2);
}

.news-item.read {
    opacity: 0.45;
    border-color: var(--divider);
    box-shadow: none;
    position: relative;
}

body.hide-read .news-item.read {
    display: none;
}

body.show-read .news-item.read {
    opacity: 0.35;
}

body.pdf-selection-mode .news-item {
    cursor: pointer;
}

body.pdf-selection-mode .news-item.pdf-selectable {
    border: 2px dashed var(--primary-color);
    background: rgba(37, 99, 235, 0.08);
}

.news-item.pdf-selected {
    background: rgba(37, 99, 235, 0.12);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-2);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.news-source {
    font-size: 0.9em;
    color: var(--primary-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 6px 12px;
    background: rgba(37, 99, 235, 0.12);
    border-radius: 16px;
    display: inline-block;
    box-shadow: none;
}

.news-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.read-checkbox {
    display: none;
}

.read-label {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 2px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-primary);
    box-shadow: var(--shadow-1);
}

.read-checkbox:checked + .read-label {
    background: var(--gradient-success);
    border-color: var(--success);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-2);
}

.read-label:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.action-btn {
    background: var(--bg-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    color: var(--text-secondary);
    font-size: 1.1em;
    box-shadow: var(--shadow-1);
}

.action-btn:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-dark);
}

.like-btn:hover {
    background: rgba(34, 134, 58, 0.15);
    color: var(--success);
}

.dislike-btn:hover {
    background: rgba(209, 26, 42, 0.15);
    color: var(--error);
}

.news-title {
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.news-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.45em;
    font-weight: 600;
    transition: color 0.2s ease;
    line-height: 1.4;
    display: block;
}

.news-title a:hover {
    color: var(--primary-dark);
}

.news-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.05em;
    position: relative;
    z-index: 2;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    color: var(--text-secondary);
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--divider);
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.news-date {
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.news-date::before {
    content: '\f073';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    color: var(--primary-color);
}

.read-more {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-2);
}

.read-more:hover {
    transform: translateX(-4px) translateY(-2px);
    box-shadow: var(--shadow-3);
}

.read-more i {
    font-size: 0.9em;
}

/* Comments Section - Enhanced */
.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--divider);
    position: relative;
    z-index: 2;
}

.add-comment {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-comment input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--divider);
    border-radius: 25px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s;
    font-weight: 500;
}

.add-comment input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: white;
}

.add-comment button {
    padding: 14px 28px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--shadow-2);
}

.add-comment button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-3);
}

.comments-list {
    max-height: 350px;
    overflow-y: auto;
}

.comment-item {
    padding: 16px;
    margin: 10px 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, white 100%);
    border-radius: 16px;
    border-right: 4px solid var(--primary-color);
    box-shadow: var(--shadow-1);
    transition: all 0.3s;
}

.comment-item:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow-2);
}

.comment-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.comment-date {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-right: 10px;
}

.bi-stats {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--divider);
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.likes-count, .dislikes-count {
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: 20px;
}

/* Panels - App-like */
.custom-sources-panel,
.settings-panel,
.bi-panel,
.custom-view-panel,
.rates-panel,
.stocks-panel,
.jewish-panel,
.calendar-panel {
    position: fixed;
    top: 70px;
    right: 0;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 70px);
    background: var(--surface);
    border-radius: 20px 0 0 20px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    padding: 24px;
    z-index: 1001;
    display: none;
    overflow-y: auto;
    direction: rtl;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    /* Full-screen app-like modal */
}

@media (max-width: 720px) {
    .custom-sources-panel,
    .settings-panel,
    .bi-panel,
    .custom-view-panel,
    .rates-panel,
    .stocks-panel,
    .jewish-panel,
    .calendar-panel {
        top: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: none;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        padding: calc(22px + env(safe-area-inset-top, 0)) 18px calc(28px + env(safe-area-inset-bottom, 0));
        box-shadow: none;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }
}

@media (min-width: 768px) {
    .custom-sources-panel,
    .settings-panel,
    .bi-panel,
    .custom-view-panel,
    .rates-panel,
    .stocks-panel,
    .jewish-panel,
    .calendar-panel {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 600px;
        max-height: 85vh;
        border-radius: 24px;
        box-shadow: var(--shadow-4);
        padding: 28px;
        animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-sources-panel.active,
.settings-panel.active,
.bi-panel.active,
.custom-view-panel.active,
.rates-panel.active,
.stocks-panel.active,
.jewish-panel.active,
.calendar-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 24px 20px 0;
    border-bottom: 2px solid var(--divider);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 5;
}

.panel-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 80px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.panel-header h3 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.6em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-content {
    margin-top: 0;
}

.bi-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 900px) {
    .bi-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 640px) {
    .rates-grid,
    .stocks-grid,
    .bi-grid,
    .bi-chart-grid,
    .jewish-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rate-card,
    .stock-card,
    .index-card,
    .bi-section,
    .jewish-card {
        padding: 16px;
    }

    .bi-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .bi-metric {
        text-align: left;
    }

    .source-filters {
        margin: 8px 12px;
        border-radius: 10px;
    }

    .filter-content {
        padding: 12px;
    }
}

.bi-section {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bi-section h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bi-section h4 i {
    color: var(--primary-color);
}

.bi-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bi-list-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 12px;
}

.bi-list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bi-list-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.bi-metric {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.95em;
    text-align: right;
    min-width: 90px;
}

.bi-note {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.bi-tone-success .bi-metric,
.bi-tone-success .bi-list-title i {
    color: var(--success);
}

.bi-tone-error .bi-metric,
.bi-tone-error .bi-list-title i {
    color: var(--error);
}

.bi-tone-warning .bi-metric,
.bi-tone-warning .bi-list-title i {
    color: var(--warning);
}

.bi-tone-primary .bi-metric,
.bi-tone-primary .bi-list-title i {
    color: var(--primary-dark);
}

.add-source-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.add-source-form input {
    padding: 14px 20px;
    border: 2px solid var(--divider);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s;
    font-weight: 500;
}

.add-source-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: white;
}

.add-source-form button {
    padding: 14px 28px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--shadow-2);
}

.add-source-form button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-3);
}

.setting-item {
    margin-bottom: 28px;
}

.setting-item label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05em;
}

.setting-item select,
.setting-item input[type="range"] {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--divider);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s;
    font-weight: 500;
}

.setting-item select:focus,
.setting-item input[type="range"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.setting-item input[type="checkbox"] {
    width: 28px;
    height: 28px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Custom View - Enhanced */
.custom-news-container {
    min-height: 350px;
    padding: 28px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, white 100%);
    border-radius: 20px;
    border: 3px dashed var(--divider);
    transition: all 0.3s;
}

.custom-news-container:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

/* Accessibility Panel - Enhanced */
.accessibility-panel {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 1000;
}

.material-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* App-like FAB */
}

.material-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.material-fab:active {
    transform: scale(0.9);
}

.accessibility-menu {
    position: absolute;
    bottom: 80px;
    left: 0;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-3);
    padding: 16px;
    min-width: 240px;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.accessibility-menu button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, white 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: right;
    margin: 6px 0;
    transition: all 0.3s;
    font-size: 1em;
    font-weight: 500;
    box-shadow: var(--shadow-1);
}

.accessibility-menu button:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(-6px);
    box-shadow: var(--shadow-2);
}

/* Footer - Enhanced */
footer {
    margin-top: 80px;
    padding: 50px 24px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-top: 1px solid var(--divider);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.donation-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid var(--divider);
}

.donate-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 16px;
    transition: all 0.3s;
    box-shadow: var(--shadow-3);
}

.donate-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-4);
}

/* Loading - Enhanced */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 1.2em;
    font-weight: 500;
}

.no-news {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-secondary);
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow-2);
    font-size: 1.2em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 14px 18px calc(14px + env(safe-area-inset-top, 0));
        background: linear-gradient(145deg, #111827, #1e293b);
        border-bottom: 1px solid rgba(15, 23, 42, 0.25);
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
        --nav-btn-bg: rgba(148, 163, 184, 0.22);
        --nav-btn-border: rgba(148, 163, 184, 0.4);
        --nav-btn-color: #f8fafc;
        --nav-btn-bg-hover: rgba(59, 130, 246, 0.5);
        --nav-btn-border-hover: rgba(59, 130, 246, 0.6);
        --nav-btn-bg-active: rgba(37, 99, 235, 0.68);
        --nav-btn-bg-active-state: rgba(37, 99, 235, 0.8);
        --nav-btn-border-active-state: rgba(37, 99, 235, 0.7);
        --nav-info-bg: rgba(15, 23, 42, 0.5);
        --nav-info-color: #e2e8f0;
    }

    .nav-center h1 {
        font-size: 1.4em;
    }
    
    .nav-left, .nav-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-quick-actions.open {
        width: 100%;
        justify-content: center;
    }
    
    .currency-panel {
        width: 95%;
        right: 2.5%;
        top: 70px;
    }
    
    .news-item {
        padding: 20px;
    }
    
    .news-title a {
        font-size: 1.3em;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .checkbox-group {
        flex-direction: column;
    }
    
    .rates-grid {
        grid-template-columns: 1fr;
    }
    
    .accessibility-panel {
        bottom: 20px;
        left: 20px;
    }
}

/* Print Styles */
@media print {
    .top-nav,
    .source-filters,
    .news-actions,
    .accessibility-panel,
    footer {
        display: none;
    }
    
    .news-item {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Scrollbar Styling - Enhanced */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Additional Animations - Subtle */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* App-like transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a, .clickable {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    user-select: none;
    -webkit-user-select: none;
}

.news-item {
    animation: fadeIn 0.3s ease-out;
}

/* App-like loading state */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.news-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Gradient Text Effects */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hamburger Menu - App-like */
.hamburger-menu {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s;
    /* App-like button */
}

.hamburger-menu span {
    width: 24px;
    height: 3px;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 2px;
    transition: all 0.3s;
    display: block;
}

body.dark-mode .hamburger-menu span {
    background: #f8fafc;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.hamburger-menu:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-4);
}

/* Side Menu - App-like */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: var(--surface);
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    z-index: 1002;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    direction: rtl;
    border-left: none;
    transform: translateX(100%);
}

.side-menu.active {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .side-menu {
        width: min(280px, calc(100% - 48px));
        border-radius: 0 0 0 24px;
    }
}

@media (max-width: 480px) {
    .side-menu {
        width: calc(100% - 32px);
        border-radius: 0 0 0 20px;
    }
}

.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu-header {
    background: var(--gradient-primary);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-2);
}

.side-menu-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.close-menu-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 1.2em;
}

.close-menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.side-menu-content {
    padding: 16px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
    border-right: 4px solid transparent;
    font-weight: 500;
    position: relative;
}

.menu-item:hover {
    background: var(--primary-light);
    border-right-color: var(--primary-color);
    transform: translateX(-4px);
    color: var(--primary-color);
}

.menu-item.is-active {
    background: rgba(37, 99, 235, 0.12);
    border-right-color: var(--primary-color);
    color: var(--primary-dark);
}

.menu-item.is-active i {
    color: var(--primary-dark);
}

.menu-item i {
    font-size: 1.3em;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

.menu-item span {
    flex: 1;
}

.notification-badge {
    background: var(--error);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75em;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Notification Container - Organized, Non-intrusive */
.notification-container {
    position: fixed;
    top: 60px;
    right: 16px;
    max-width: 320px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    /* Only show one at a time - top right corner */
}

.notification-overlay {
    display: none;
}

body.notification-active {
    overflow: auto;
}

body.notification-active .news-container,
body.notification-active .source-filters,
body.notification-active .top-nav {
    visibility: visible;
    opacity: 1;
}

/* Toast notifications (small, non-intrusive, auto-dismiss) */
.notification {
    max-width: 320px;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.toast-notification {
    max-width: 320px;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.notification.toast-notification .notification-content {
    font-size: 0.85em;
    padding: 0;
}

.notification.toast-notification .notification-text {
    flex: 1;
}

.notification.toast-notification .notification-text strong {
    font-size: 0.9em;
    display: block;
    margin-bottom: 4px;
}

.notification.toast-notification .notification-text span {
    font-size: 0.8em;
    opacity: 0.9;
}

/* Removed duplicate - using the organized version above */

.notification-success {
    border-left-color: var(--success);
    background: #1f3a2a;
}

.notification-error {
    border-left-color: var(--error);
    background: #3b1f28;
}

.notification-warning {
    border-left-color: var(--warning);
    background: #3a301e;
}

.notification-info {
    border-left-color: var(--primary-color);
    background: #1e2a3b;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.notification-content i {
    font-size: 1.2em;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-success .notification-content i {
    color: var(--success);
}

.notification-error .notification-content i {
    color: var(--error);
}

.notification-warning .notification-content i {
    color: var(--warning);
}

.notification-info .notification-content i {
    color: var(--primary-color);
}

.notification-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.notification-text strong {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 2px;
}

.notification-text span {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.notification-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.notification-btn {
    position: relative;
    flex-shrink: 0;
}

.dark-mode-btn {
    flex-shrink: 0;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--error);
    border-radius: 9px;
    border: 2px solid white;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.notification-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid white;
    z-index: 1;
    /* Removed pulse animation - static dot */
}

/* Ensure buttons don't overlap */
.nav-right {
    min-width: fit-content;
}

@media (max-width: 480px) {
    .nav-right .refresh-info {
        font-size: 0.65em;
    }
    
    .nav-right .refresh-info span {
        display: none; /* Hide text, show only icon on very small screens */
    }
    
    .nav-right .material-btn {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }
}

/* Swipe Indicator */
.swipe-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: var(--shadow-3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    font-weight: 500;
    transition: opacity 0.5s, transform 0.3s;
    /* Removed bounce animation */
}

.swipe-indicator:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: var(--shadow-4);
}

.swipe-indicator i {
    font-size: 1.3em;
    /* Removed swipe animation */
}

/* Swipe Navigation - App-like */
.swipe-navigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 998;
    /* App-like floating buttons */
}

.swipe-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(31, 78, 189, 0.25);
    color: var(--primary-dark);
    border: 1px solid rgba(31, 78, 189, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    /* App-like FAB */
}

@media (min-width: 768px) {
    .swipe-navigation {
        bottom: 30px;
        gap: 16px;
    }
    
    .swipe-nav-btn {
        width: 56px;
        height: 56px;
        font-size: 1.5em;
    }
}

.swipe-nav-btn:hover {
    background: rgba(31, 78, 189, 0.35);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.swipe-nav-btn:active {
    transform: scale(0.95);
}

/* Mobile Responsive - App-like */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .top-nav {
        padding: 8px 12px;
        min-height: 50px;
        flex-wrap: wrap;
    }
    
    .top-nav .nav-left {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .top-nav .nav-right .refresh-info {
        font-size: 0.65em;
    }
    
    .top-nav .nav-right .refresh-info span {
        display: none; /* Hide text, show only icon on very small screens */
    }
    
    .top-nav .nav-center {
        order: 2;
        flex: 1 1 100%;
        margin-top: 4px;
    }
    
    .top-nav .nav-center h1 {
        font-size: 1.1em;
    }
    
    .notification-container {
        left: 10px;
        right: 10px;
        max-width: 100%;
        top: 60px;
    }
    
    .notification {
        min-width: auto;
        width: 100%;
        padding: 12px 14px;
        font-size: 0.9em;
    }
    
    .news-container {
        padding: 10px;
        gap: 10px;
    }
    
    .news-item {
        padding: 14px;
        border-radius: 12px;
        margin-bottom: 8px;
    }
    
    .news-title {
        font-size: 1.1em;
        line-height: 1.4;
    }
    
    .news-description {
        font-size: 0.9em;
        line-height: 1.5;
    }
    
    .source-filters {
        margin: 10px;
        padding: 14px;
        border-radius: 12px;
    }
    
    .source-filters h3 {
        font-size: 1.1em;
    }
    
    .swipe-navigation {
        bottom: 16px;
    }
    
    .swipe-nav-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2em;
    }
    
    .material-fab {
        width: 48px;
        height: 48px;
        font-size: 1.4em;
        bottom: 20px;
        left: 20px;
    }
    
    /* App-like safe area for mobile */
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* App-like bottom navigation */
    .top-nav {
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    /* App-like touch targets */
    .material-btn,
    .action-btn,
    .swipe-nav-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Full-width panels on mobile */
    .currency-panel {
        width: 100%;
        right: 0;
        border-radius: 20px 0 0 20px;
    }
    
    .settings-panel,
    .custom-sources-panel,
    .bi-panel {
        padding: 16px;
    }
    
    .setting-item {
        margin-bottom: 12px;
    }
    
    .setting-item label {
        font-size: 0.9em;
    }
    
    .setting-item input[type="color"] {
        width: 60px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 10px 12px calc(10px + env(safe-area-inset-top, 0));
        min-height: 52px;
    }

    .nav-left .material-btn,
    .nav-right .material-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8em;
    }

    .nav-quick-actions.open {
        padding: 6px;
        gap: 6px;
    }

    .top-nav .nav-center h1 {
        font-size: 1em;
    }
    
    .top-nav .nav-center .subtitle {
        font-size: 0.65em;
    }
    
    .news-item {
        padding: 12px;
    }
    
    .news-title {
        font-size: 1em;
    }
    
    .news-description {
        font-size: 0.85em;
    }
}

/* App-like status bar spacing */
@supports (padding: max(0px)) {
    body {
        padding-top: max(0px, env(safe-area-inset-top));
    }
    
    .top-nav {
        padding-top: max(12px, calc(12px + env(safe-area-inset-top)));
    }
    
    .swipe-navigation {
        bottom: max(20px, calc(20px + env(safe-area-inset-bottom)));
    }
    
    .material-fab {
        bottom: max(20px, calc(20px + env(safe-area-inset-bottom)));
        left: max(20px, calc(20px + env(safe-area-inset-left)));
    }
}

.rate-card:hover, .stock-card:hover, .index-card:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: var(--shadow-2);
}

.jewish-grid {
    display: grid;
    gap: 16px;
}

.jewish-card {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jewish-card h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.jewish-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
    background: rgba(31, 78, 189, 0.12);
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.jewish-times {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.9em;
}

.jewish-times span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.jewish-details {
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.5;
}

.jewish-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.install-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: #1e2a3b;
    color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
    padding: 16px 20px;
    z-index: 1100;
    display: none;
    align-items: center;
}

.install-banner.visible {
    display: flex;
}

.install-banner .banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.install-banner strong {
    font-size: 1em;
}

.install-banner p {
    margin: 4px 0 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-btn {
    background: #ffffff;
    color: #1f4ebd;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.banner-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.banner-dismiss {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 1.1em;
}

@media (max-width: 640px) {
    .install-banner {
        bottom: env(safe-area-inset-bottom, 12px);
        left: 10px;
        right: 10px;
        background: #ffffff;
        color: var(--text-primary);
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
        padding: 14px;
    }

    .install-banner p {
        color: var(--text-secondary);
    }

    .banner-btn {
        background: var(--primary-color);
        color: #ffffff;
    }

    .banner-btn:hover {
        background: var(--primary-dark);
        color: #ffffff;
    }

    .banner-dismiss {
        color: var(--text-secondary);
    }
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.calendar-nav-btn {
    background: var(--bg-primary);
    border: 1px solid var(--divider);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.calendar-nav-btn:hover {
    background: rgba(31, 78, 189, 0.12);
    border-color: rgba(31, 78, 189, 0.25);
}

.calendar-title {
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--text-secondary);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--divider);
}

.calendar-cell {
    min-height: 92px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85em;
    position: relative;
    box-shadow: var(--shadow-1);
}

.calendar-cell.muted {
    opacity: 0.45;
    background: var(--bg-primary);
}

.calendar-cell.today {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(31, 78, 189, 0.1);
}

.calendar-greg {
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-hebrew {
    font-size: 0.75em;
    color: var(--text-secondary);
}

.calendar-events {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-event {
    font-size: 0.75em;
    color: var(--primary-dark);
    display: flex;
    gap: 6px;
    align-items: center;
}

.calendar-event i {
    font-size: 0.8em;
}

.notification-btn {
    position: relative;
}

.notification-btn.has-notification {
    animation: bellPulse 0.8s ease;
}

@keyframes bellPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.1); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Ensure buttons don't overlap */
.nav-right {
    min-width: fit-content;
}

.notification-drawer {
    position: fixed;
    top: calc(70px + env(safe-area-inset-top, 0));
    right: 20px;
    width: 340px;
    max-height: calc(100vh - 100px);
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    z-index: 1100;
    display: none;
    overflow: hidden;
}

.notification-drawer.open {
    display: flex;
    flex-direction: column;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider);
}

.drawer-header h3 {
    margin: 0;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.drawer-actions {
    display: flex;
    gap: 8px;
}

.drawer-btn {
    background: var(--bg-primary);
    border: 1px solid var(--divider);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85em;
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease;
}

.drawer-btn:hover {
    background: rgba(31, 78, 189, 0.1);
    color: var(--primary-dark);
}

.drawer-content {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.notification-empty {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.notification-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 12px;
}

.notification-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.notification-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 78, 189, 0.08);
    color: var(--primary-dark);
}

.notification-success { color: var(--success); background: rgba(34, 134, 58, 0.12); }
.notification-error { color: var(--error); background: rgba(209, 26, 42, 0.12); }
.notification-warning { color: var(--warning); background: rgba(245, 158, 11, 0.15); }

.notification-row-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-primary);
}

.notification-row-text span {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.notification-row-text time {
    display: block;
    font-size: 0.75em;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .notification-drawer {
        top: calc(60px + env(safe-area-inset-top, 0));
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 80px);
    }
}

body.dark-mode .notification-drawer {
    background: #1E1E1E;
    border-color: #333333;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

body.dark-mode .drawer-btn {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
    color: var(--text-secondary);
}

body.dark-mode .drawer-btn:hover {
    background: rgba(100, 181, 246, 0.15);
    color: var(--primary-light);
}

body.dark-mode .notification-row-icon {
    background: rgba(100, 181, 246, 0.12);
    color: var(--primary-light);
}

.toggle-icons-btn {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(79, 70, 229, 0.95));
    color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.25);
}

.toggle-icons-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

.nav-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    margin-inline-start: 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
    max-width: 100%;
}

.nav-quick-actions .material-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
    box-shadow: none;
}

.nav-quick-actions .material-btn.is-active,
.nav-quick-actions .material-btn:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.25));
    border-color: rgba(59, 130, 246, 0.4);
    color: #0f172a;
}

@media (max-width: 640px) {
    .nav-quick-actions {
        display: none;
        width: 100%;
        justify-content: flex-start;
        margin-inline: 0;
        padding: 10px;
    }

    .nav-quick-actions.open {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-inline: 0;
        background: rgba(255, 255, 255, 0.2);
    }

    .toggle-icons-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 420px) {
    .nav-left,
    .nav-right {
        gap: 4px;
    }

    .nav-left .material-btn,
    .nav-right .material-btn {
        width: 30px;
        height: 30px;
        font-size: 0.75em;
    }

    .nav-quick-actions.open {
        gap: 4px;
    }
}

@media (max-width: 360px) {
    .nav-left .material-btn,
    .nav-right .material-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7em;
    }

    .nav-center h1 {
        font-size: 0.95em;
    }

    .nav-center .subtitle {
        font-size: 0.55em;
    }
}

body.dark-mode .toggle-icons-btn {
    background: linear-gradient(135deg, #1f3c88, #4338ca);
    color: #f8fafc;
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.4);
}

body.dark-mode .nav-quick-actions {
    background: rgba(15, 23, 42, 0.55);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.5);
}

body.dark-mode .nav-quick-actions.open {
    background: rgba(15, 23, 42, 0.65);
}

body.dark-mode .nav-quick-actions .material-btn {
    background: rgba(148, 163, 184, 0.22);
    border-color: rgba(148, 163, 184, 0.26);
    color: #f8fafc;
}

body.dark-mode .nav-quick-actions .material-btn:hover,
body.dark-mode .nav-quick-actions .material-btn.is-active {
    color: #e2e8f0;
}

.bi-list-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 12px;
}

.bi-list-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.bi-progress {
    width: 100%;
    margin-top: 8px;
}

.bi-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.bi-progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.bi-progress-label {
    display: block;
    margin-top: 4px;
    font-size: 0.75em;
    color: var(--text-secondary);
    font-weight: 600;
}

.bi-progress-bar.bi-tone-success {
    background: var(--success);
}

.bi-progress-bar.bi-tone-error {
    background: var(--error);
}

.bi-progress-bar.bi-tone-warning {
    background: var(--warning);
}

.bi-progress-bar.bi-tone-primary {
    background: var(--primary-color);
}

.bi-visual {
    grid-column: 1 / -1;
}

.bi-chart-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.bi-chart-card {
    background: var(--bg-primary);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow-1);
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.bi-chart-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bi-chart-title i {
    color: var(--primary-color);
}

.bi-chart-canvas {
    position: relative;
    flex: 1;
    min-height: 160px;
}

.bi-chart-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

body.dark-mode .bi-progress-track {
    background: rgba(148, 163, 184, 0.35);
}

body.dark-mode .bi-progress-label {
    color: #cbd5f5;
}

body.dark-mode .bi-chart-card {
    background: #101828;
    box-shadow: none;
}

.toggle-icons-btn.open {
    background: var(--gradient-primary);
    color: #ffffff;
}

body.dark-mode .toggle-icons-btn.open {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

/* Workspace & Auth Panels -------------------------------------------------- */
.panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1500;
}

.panel-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.auth-panel,
.workspace-panel,
.chat-panel {
    position: fixed;
    right: 20px;
    top: calc(90px + env(safe-area-inset-top, 0));
    width: min(420px, calc(100% - 32px));
    max-height: calc(100vh - 140px);
    overflow: hidden;
    display: none;
    z-index: 1600;
    padding: 0;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.auth-panel.open,
.workspace-panel.open,
.chat-panel.open {
    opacity: 1;
    transform: translateY(0);
}

.auth-panel .panel-content,
.workspace-panel .panel-content,
.chat-panel .panel-content {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 24px 24px;
}

.panel-description {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.6;
}

.panel-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 14px;
}

.panel-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.panel-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9em;
}

.panel-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--divider);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.panel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    padding: 10px 16px;
    border: 1px solid transparent;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.panel-button.primary {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow-1);
}

.panel-button.secondary {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--primary-dark);
}

.panel-button.tertiary {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.15);
    color: var(--text-primary);
}

.panel-button.link {
    background: transparent;
    border: none;
    color: var(--primary-dark);
    padding: 6px 10px;
    font-weight: 500;
}

.panel-button.full {
    width: 100%;
}

.panel-button:not(.link):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

.panel-status {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9em;
    line-height: 1.5;
}

.panel-status.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-dark);
}

.panel-status.success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.panel-status.error {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.panel-status.small {
    font-size: 0.8em;
}

.panel-fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.fieldset-label {
    width: 100%;
    font-size: 0.8em;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    align-items: center;
}

.panel-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: var(--text-primary);
}

.panel-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.checkbox-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85em;
    color: var(--text-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
    position: relative;
    user-select: none;
}

.checkbox-chip input {
    accent-color: var(--primary-color);
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.checkbox-chip:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--primary-dark);
}

.checkbox-chip:has(input:checked) {
    background: var(--gradient-primary);
    color: #ffffff;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.checkbox-chip:has(input:checked)::after {
    content: '\2713';
    margin-right: 6px;
    font-weight: 700;
}

.bi-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-dark);
    font-size: 0.8em;
    font-weight: 600;
}

.bi-history-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.bi-history-row {
    padding: 12px 14px;
    border: 1px solid var(--divider);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-1);
}

.bi-history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.bi-history-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--text-primary);
}

.bi-history-meta i {
    color: var(--primary-color);
}

.bi-history-meta time {
    font-size: 0.8em;
}

.bi-history-details {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.5;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-card {
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-1);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-card.active {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-card-header h4 {
    margin: 0;
    font-size: 1.1em;
}

.dashboard-modules {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.dashboard-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.dashboard-share {
    background: rgba(37, 99, 235, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-field input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: #fff;
    font-size: 0.9em;
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 2fr;
    gap: 16px;
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 6px;
}

.chat-room-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-room-card {
    border: 1px solid var(--divider);
    border-radius: 14px;
    padding: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-room-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: var(--shadow-2);
}

.chat-room-meta p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.chat-room-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.chat-room-card .chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-secondary);
}

.chat-room-card .chip.owner {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-dark);
}

.chat-room-card .chip.member {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
}

.chat-room-card .chip.locked {
    background: rgba(220, 38, 38, 0.15);
    color: #991b1b;
}

.chat-view {
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface);
    min-height: 300px;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.chat-placeholder i {
    font-size: 2em;
    color: var(--primary-color);
}

.chat-room-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.chat-room-header h4 {
    margin: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--divider);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
}

.chat-message {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-secondary);
}

.chat-message-body {
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
}

.public-dashboard-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(37, 99, 235, 0.24);
    border-radius: 14px;
    padding: 12px 18px;
    margin: 12px 16px;
    color: var(--primary-dark);
}

.public-dashboard-banner .banner-text p {
    margin: 4px 0 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .auth-panel,
    .workspace-panel,
    .chat-panel {
        right: 12px;
        left: 12px;
        width: auto;
        top: calc(80px + env(safe-area-inset-top, 0));
        max-height: calc(100vh - 120px);
    }

    .chat-messages {
        max-height: 240px;
    }

    .public-dashboard-banner {
        margin: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
}

body.dark-mode .auth-panel,
body.dark-mode .workspace-panel,
body.dark-mode .chat-panel {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

body.dark-mode .panel-input {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
}

body.dark-mode .dashboard-card,
body.dark-mode .chat-room-card,
body.dark-mode .chat-view {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.2);
}

body.dark-mode .chat-message {
    background: rgba(59, 130, 246, 0.18);
}

body.dark-mode .panel-header {
    background: #0f172a;
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .close-btn {
    background: rgba(15, 23, 42, 0.85);
    color: #cbd5f5;
}

body.dark-mode .checkbox-chip {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5f5;
}

body.dark-mode .checkbox-chip:hover {
    background: rgba(59, 130, 246, 0.14);
    color: #e2e8f0;
}

body.dark-mode .checkbox-chip:has(input:checked) {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

body.dark-mode .history-chip {
    background: rgba(59, 130, 246, 0.18);
    color: #cbd5f5;
}

body.dark-mode .bi-history-row {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.4);
}

body.dark-mode .bi-history-meta {
    color: #94a3b8;
}

body.dark-mode .bi-history-details {
    color: #cbd5f5;
}

body.side-menu-open {
    overflow: hidden;
    width: 100%;
    position: relative;
}
