/* ===== Bagrut Bank - Public Page ===== */

/* Hebrew font for mixed content */
:lang(he),
[lang="he"] {
    font-family: 'Heebo', sans-serif;
}

.bb-hero {
    position: relative;
    background: linear-gradient(135deg, #0F172A 0%, #1E40AF 50%, #06B6D4 100%);
    padding: 80px 0 60px;
    text-align: center;
    overflow: hidden;
    margin-top: -1px;
}

.bb-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 40%);
}

.bb-hero-content {
    position: relative;
    z-index: 1;
    color: white;
}

.bb-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.3);
}

.bb-hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.bb-hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

.bb-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Mode Switcher */
.bb-mode-switcher {
    display: flex;
    gap: 0;
    background: #f1f5f9;
    border-radius: 16px;
    padding: 6px;
    margin: -30px auto 40px;
    max-width: 500px;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.bb-mode-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Tajawal', sans-serif;
}

.bb-mode-btn.active {
    background: white;
    color: #1E40AF;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.15);
}

.bb-mode-btn:hover:not(.active) {
    color: #475569;
    background: rgba(255,255,255,0.5);
}

/* Table (Mode 1) */
.bb-table-year-group {
    margin-bottom: 28px;
}

.bb-grid-table-wrap {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(30,64,175,0.08);
    border: 2px solid #cbd5e1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bb-grid-tbl {
    width: 100%;
    border-collapse: collapse;
}

.bb-grid-tbl thead tr {
    background: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
}

.bb-th-year {
    width: 70px;
    min-width: 70px;
    padding: 10px 6px;
    text-align: center;
    font-weight: 800;
    color: #475569;
    font-size: 0.82rem;
    background: #f1f5f9;
}

.bb-th-season {
    width: 100px;
    min-width: 100px;
    padding: 10px 8px;
    text-align: center;
    font-weight: 700;
    color: #475569;
    font-size: 0.82rem;
    background: #f1f5f9;
}

.bb-th-exam {
    padding: 10px 4px;
    text-align: center;
    font-weight: 700;
    color: #1E40AF;
    font-size: 0.9rem;
    font-family: 'Heebo', 'Tajawal', sans-serif;
}

.bb-grid-tbl tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

.bb-grid-tbl tbody tr:last-child {
    border-bottom: none;
}

.bb-grid-tbl tbody tr:hover {
    background: #fafbfd;
}

.bb-td-year {
    padding: 10px 6px;
    text-align: center;
    font-weight: 900;
    color: #1E40AF;
    font-size: 1.15rem;
    background: #f8fafc;
    border-left: 2px solid #cbd5e1;
    vertical-align: middle;
    font-family: 'Heebo', 'Tajawal', sans-serif;
}

.bb-td-season {
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    color: #475569;
    font-size: 0.82rem;
    background: #fafbfc;
    border-left: 1px solid #e2e8f0;
    white-space: nowrap;
    font-family: 'Heebo', 'Tajawal', sans-serif;
}

.bb-td-files {
    padding: 6px 3px;
    text-align: center;
    vertical-align: middle;
}

.bb-td-empty {
    background: #fafbfc;
}

.bb-th-topic-col {
    padding: 10px 6px;
    text-align: center;
    font-weight: 700;
    color: #475569;
    font-size: 0.82rem;
    background: #f1f5f9;
    font-family: 'Tajawal', sans-serif;
}

.bb-td-topic-col {
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    color: #475569;
    font-size: 0.82rem;
    font-family: 'Heebo', 'Tajawal', sans-serif;
    white-space: nowrap;
}

.bb-td-topic-name {
    color: #1e293b;
    font-weight: 700;
}

.bb-tbl-btn {
    display: block;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 2px auto;
    font-family: 'Tajawal', sans-serif;
    background: #eff6ff;
    color: #1E40AF;
    border: 1px solid #dbeafe;
}

#topicSection .bb-tbl-btn {
    display: inline-block;
    margin: 2px 1px;
    padding: 4px 8px;
}

.bb-tbl-btn:hover {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #bfdbfe;
}

.bb-tbl-empty {
    display: block;
    height: 22px;
    margin: 2px auto;
}

#topicSection .bb-tbl-empty {
    display: inline-block;
    width: 0;
    height: 0;
    margin: 0;
}

/* Responsive table */
@media (max-width: 768px) {
    .bb-th-year {
        width: 50px;
        min-width: 50px;
        font-size: 0.9rem;
        padding: 6px 3px;
    }

    .bb-td-year {
        font-size: 0.9rem;
        padding: 6px 3px;
    }

    .bb-th-season {
        width: 70px;
        min-width: 70px;
        padding: 6px 3px;
        font-size: 0.7rem;
    }

    .bb-td-season {
        padding: 6px 3px;
        font-size: 0.7rem;
    }

    .bb-tbl-btn {
        font-size: 0.68rem;
        padding: 3px 2px;
    }

    .bb-th-exam {
        font-size: 0.72rem;
        padding: 6px 2px;
    }

    .bb-th-topic-col {
        font-size: 0.7rem;
        padding: 6px 3px;
    }

    .bb-td-topic-col {
        font-size: 0.7rem;
        padding: 6px 3px;
    }
}

/* Filters (Mode 2) */
.bb-filters {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.bb-filter-row {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.bb-filter-row:last-child {
    margin-bottom: 0;
}

.bb-filter-group {
    flex: 1;
    min-width: 200px;
}

.bb-filter-full {
    flex: 1 1 100%;
}

.bb-filter-group label {
    display: block;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.bb-units-selector {
    display: flex;
    gap: 8px;
}

.bb-unit-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

.bb-unit-btn.active {
    border-color: #1E40AF;
    background: linear-gradient(135deg, #1E40AF, #06B6D4);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.bb-unit-btn:hover:not(.active) {
    border-color: #1E40AF;
    color: #1E40AF;
    background: rgba(30, 64, 175, 0.04);
}

.bb-select, .bb-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Heebo', 'Tajawal', sans-serif;
    appearance: auto;
}

.bb-select:focus, .bb-input:focus {
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

/* Autocomplete */
.bb-autocomplete-wrapper {
    position: relative;
}

.bb-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.bb-autocomplete-dropdown.show {
    display: block;
}

.bb-autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    border-bottom: 1px solid #f8fafc;
    font-family: 'Heebo', 'Tajawal', sans-serif;
}

.bb-autocomplete-item:hover,
.bb-autocomplete-item.highlighted {
    background: #eff6ff;
    color: #1E40AF;
}

.bb-autocomplete-item:last-child {
    border-bottom: none;
}

/* Placeholder */
.bb-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.bb-placeholder i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.4;
}

.bb-placeholder h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 10px;
}

.bb-placeholder p {
    font-size: 1rem;
    line-height: 1.7;
}


/* Loading */
.bb-loading {
    text-align: center;
    padding: 40px;
}

.bb-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid #1E40AF;
    border-radius: 50%;
    animation: bbSpin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes bbSpin {
    to { transform: rotate(360deg); }
}

/* CTA */
.bb-cta {
    margin-top: 50px;
    background: linear-gradient(135deg, #0F172A 0%, #1E40AF 100%);
    border-radius: 20px;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bb-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 50%, rgba(6,182,212,0.15) 0%, transparent 50%),
        radial-gradient(circle at 90% 30%, rgba(6,182,212,0.1) 0%, transparent 40%);
}

.bb-cta-content {
    position: relative;
    z-index: 1;
}

.bb-cta h3 {
    color: white;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.bb-cta p {
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    margin-bottom: 28px;
}

.bb-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #06B6D4;
    color: white;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(6,182,212,0.3);
}

.bb-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(6,182,212,0.4);
    background: #0891B2;
    color: white;
}

/* Empty results */
.bb-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.bb-no-results i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* Topic tag under selected */
.bb-selected-topic {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1E40AF;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-family: 'Heebo', 'Tajawal', sans-serif;
}

.bb-selected-topic button {
    background: none;
    border: none;
    color: #1E40AF;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
}

.bb-topic-tag {
    display: inline-block;
    background: #eff6ff;
    color: #1E40AF;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 8px;
    font-family: 'Heebo', 'Tajawal', sans-serif;
}

.bb-exam-tag {
    color: #64748b;
    font-family: 'Heebo', 'Tajawal', sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
    .bb-hero {
        padding: 50px 0 40px;
    }

    .bb-hero h1 {
        font-size: 1.8rem;
    }

    .bb-hero p {
        font-size: 1rem;
    }

    .bb-mode-switcher {
        margin-top: -20px;
        max-width: 100%;
    }

    .bb-mode-btn {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .bb-filters {
        padding: 20px;
    }

    .bb-filter-row {
        flex-direction: column;
        gap: 16px;
    }

    .bb-filter-group {
        min-width: 100%;
    }

    .bb-units-selector {
        flex-direction: column;
    }

    .bb-cta {
        padding: 30px 20px;
    }

    .bb-cta h3 {
        font-size: 1.4rem;
    }

    .bb-cta-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
}
