/* ==============================================================================
   BeambePrep Notes Hub & Subject Master CSS
   Visual Law: Midnight Hive Design System (docs/design-system & AGENTS.md)
   ============================================================================== */

/* Viewport 98% Width Law */
.container,
.container-lg,
.container-xl,
.container-xxl,
div.container.pb-5.flex-grow-1,
body > .container {
    max-width: 98% !important;
    width: 98% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Hub Wrapper & Typography */
.notes-hub-wrapper {
    color: var(--text-main, #F5F5F5);
    min-height: 85vh;
    max-width: 100%;
    overflow-x: hidden;
}

/* Hero Section */
.notes-hero {
    padding: clamp(24px, 4vw, 48px) clamp(12px, 3vw, 24px) clamp(20px, 3.5vw, 36px);
    background: radial-gradient(circle at 50% -20%, rgba(0, 229, 255, 0.12), rgba(255, 193, 7, 0.06) 45%, #0F0F0F 85%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    margin-bottom: 32px;
}

.mascot-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    width: 88px;
    height: 88px;
}

.mascot-img-sm {
    width: 84px;
    height: 84px;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(255, 193, 7, 0.3));
    animation: mascotFloat 3.2s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes mascotFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-7px) rotate(-2deg); }
}

.category-chip-row {
    margin-bottom: 14px;
}

.chip-gold {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 999px;
    color: #FFC107;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: monospace;
}

.notes-display-headline {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.notes-display-headline .gradient-text {
    background: linear-gradient(90deg, #FFC107 0%, #FFD54F 40%, #00E5FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.notes-lead-text {
    max-width: 820px;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-muted, #A3A3A3);
    margin: 0 auto 24px;
}

/* Telemetry Strip */
.notes-telemetry-pod {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 10px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 576px) {
    .notes-telemetry-pod {
        padding: 16px 14px;
    }
}

.notes-telemetry-pod:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.22);
}

/* Filter Dock */
.notes-filter-dock {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.notes-search-box-wrapper {
    position: relative;
    max-width: 480px;
    width: 100%;
}

.notes-search-input {
    background: #0D0D0D;
    color: #F5F5F5;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 11px 44px 11px 40px;
    font-size: 0.94rem;
    width: 100%;
    transition: all 0.2s ease;
}

.notes-search-input:focus {
    outline: none;
    background: #111111;
    color: #FFFFFF;
    border-color: rgba(255, 193, 7, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}

.notes-search-input::placeholder {
    color: #71717A;
}

.notes-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #71717A;
    pointer-events: none;
}

.notes-search-kbd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #A3A3A3;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: monospace;
    pointer-events: none;
}

/* Filter Pills */
.filter-pills-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.notes-filter-pill {
    background: #181818;
    color: #A3A3A3;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.notes-filter-pill:hover {
    background: #202020;
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.2);
}

.notes-filter-pill.active {
    background: rgba(255, 193, 7, 0.15) !important;
    color: #FFD54F !important;
    border-color: rgba(255, 193, 7, 0.5) !important;
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.2);
}

/* Subject Grid */
.subject-tile-card {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    padding: 22px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    text-decoration: none;
    color: var(--text-main, #F5F5F5);
    position: relative;
    overflow: hidden;
}

.subject-tile-card:hover {
    transform: translateY(-3px);
    color: #FFFFFF;
}

.subject-tile-card.subject-biology:hover {
    border-color: rgba(105, 240, 174, 0.5);
    box-shadow: 0 8px 24px rgba(105, 240, 174, 0.12);
}

.subject-tile-card.subject-physics:hover {
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.12);
}

.subject-tile-card.subject-chemistry:hover {
    border-color: rgba(255, 193, 7, 0.5);
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.12);
}

.subject-tile-card.subject-english:hover {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.12);
}

.subject-tile-card.subject-logical-reasoning:hover {
    border-color: rgba(251, 146, 60, 0.5);
    box-shadow: 0 8px 24px rgba(251, 146, 60, 0.12);
}

.subject-tile-card.subject-in-progress {
    opacity: 0.75;
    background: #111111;
    cursor: default;
}

.subject-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 14px;
    flex-shrink: 0;
}

/* Chapter Row Card (Law 7 & 8) */
.chapter-row-card {
    position: relative;
    z-index: 1;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
    .chapter-row-card {
        padding: 22px 24px;
    }
}

.chapter-row-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* Elevate card above subsequent siblings when its dropdown is open or focused */
.chapter-row-card.dropdown-open,
.chapter-row-card:focus-within,
.chapter-row-card:has(.dropdown.show),
.chapter-row-card:has(.dropdown-menu.show),
.chapter-row-card:has([aria-expanded="true"]) {
    z-index: 1050 !important;
}

.chapter-num-box {
    font-family: monospace;
    font-weight: 900;
    font-size: 1.85rem;
    line-height: 1;
    color: #FFC107;
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
}

.chapter-badge-chip {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.micro-pill {
    background: #0D0D0D;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #CCCCCC;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.edition-mode-badge {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: #00E5FF;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.03em;
    animation: fadeIn 0.2s ease-in-out;
}

/* Hashtag Strip & Chips */
.notes-hashtag-strip {
    margin-top: 8px;
}

.notes-hashtag-chip {
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #B0B0B0;
    font-size: 0.72rem;
    font-family: monospace;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.notes-hashtag-chip:hover {
    background: rgba(255, 193, 7, 0.15);
    color: #FFD54F;
    border-color: rgba(255, 193, 7, 0.4);
    transform: translateY(-1px);
}

/* Action Buttons (Law 8) */
.btn-download-action {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    border: none;
    border-radius: 10px;
    color: #050505 !important;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 8px 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.btn-download-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(255, 193, 7, 0.45);
    color: #000000 !important;
}

.btn-solve-action {
    background: #181818;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #E0E0E0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 8px 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-solve-action:hover {
    border-color: rgba(255, 193, 7, 0.4);
    color: #FFC107;
    background: #202020;
    transform: translateY(-1px);
}

.btn-shortlist-action {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #00E5FF;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 8px 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-shortlist-action:hover {
    background: rgba(0, 229, 255, 0.16);
    border-color: #00E5FF;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.btn-flashcards-pill,
.btn-action-flashcards {
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.35);
    color: #FFD54F;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 8px 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-flashcards-pill:hover,
.btn-action-flashcards:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #FFC107;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.25);
}

/* Active Edition Row Highlights */
.edition-detailed-active {
    border-color: rgba(255, 193, 7, 0.35) !important;
}

.edition-detailed-active .edition-mode-badge {
    background: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.4);
    color: #FFC107;
}

.edition-detailed-active .btn-action-detailed {
    border-color: #FFC107 !important;
    background: rgba(255, 193, 7, 0.2) !important;
    color: #FFD54F !important;
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.25);
}

.edition-shortlist-active {
    border-color: rgba(0, 229, 255, 0.35) !important;
}

.edition-shortlist-active .edition-mode-badge {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.4);
    color: #00E5FF;
}

.edition-shortlist-active .btn-action-shortlist {
    border-color: #00E5FF !important;
    background: rgba(0, 229, 255, 0.22) !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

/* Dropdown Menu Dark Theme */
.notes-dropdown-menu {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.2);
    padding: 8px;
    min-width: 240px;
    z-index: 1060 !important;
}

.notes-dropdown-item {
    color: #F5F5F5;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.notes-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFC107;
}

/* Accessible Dark FAQ Accordion (Law 16) */
.custom-accordion .accordion-item {
    background: #151515 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    margin-bottom: 0.85rem;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.custom-accordion .accordion-button {
    background: #1A1A1A !important;
    color: #F5F5F5 !important;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: none !important;
    padding: 1.15rem 1.4rem;
    border: none !important;
}

.custom-accordion .accordion-button:not(.collapsed) {
    background: #222222 !important;
    color: #FFC107 !important;
    border-bottom: 1px solid rgba(255, 193, 7, 0.25) !important;
}

.custom-accordion .accordion-button::after {
    filter: invert(1) brightness(1.2);
}

.custom-accordion .accordion-body {
    background: #121212 !important;
    color: #CCCCCC !important;
    font-size: 0.96rem;
    line-height: 1.75;
    padding: 1.4rem;
}

/* Empty Search State */
.notes-empty-state {
    background: #141414;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted, #A3A3A3);
}

/* Callout Box (Law 13) */
.callout-box {
    background: rgba(11, 15, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 1.5rem !important;
    border-radius: 1rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 576px) {
    .callout-box {
        padding: 1rem 1.15rem !important;
    }
}
