/**
 * PetCix Academy — Free Bonus Course Module Modal Styles
 * ======================================================
 * File: static/css/bonus_modal.css
 * Handles styling for:
 *  - Course card bonus buttons and hover states
 *  - Modal overlay and animated dialog container
 *  - Header badges, titles, and curriculum meta pills
 *  - Section filter navigation tabs
 *  - Structured curriculum breakdown table
 *  - Mobile responsive layouts and touch scrolling hints
 */

/* -------------------------------------------------------------------------
   1. COURSE CARD INTERACTIVE BONUS BUTTONS
   ------------------------------------------------------------------------- */
.bonus-course-btn {
    background: transparent;
    border: none;
    padding: 5px 8px;
    margin: -3px -8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    color: inherit;
    transition: background-color 0.2s ease, transform 0.15s ease;
    outline: none;
}

.bonus-course-btn:hover,
.bonus-course-btn:focus-visible {
    background: rgba(109, 61, 210, 0.08);
}

.bonus-course-btn:focus-visible {
    box-shadow: 0 0 0 2px #6D3DD2;
}

.bonus-course-btn:hover .bonus-item-name {
    color: #6D3DD2;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.bonus-course-btn:hover .bonus-check-icon {
    transform: scale(1.12);
    background: #CE4EDE;
    box-shadow: 0 2px 8px rgba(206, 78, 222, 0.4);
}

.bonus-view-pill {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    color: #6D3DD2;
    background: rgba(109, 61, 210, 0.1);
    border: 1px solid rgba(109, 61, 210, 0.2);
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.bonus-view-pill i {
    font-size: 0.65rem;
}

.bonus-course-btn:hover .bonus-view-pill {
    background: #6D3DD2;
    color: #ffffff;
    border-color: #6D3DD2;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(109, 61, 210, 0.35);
}

.cd-bonus-item .bonus-course-btn {
    font-size: 0.86rem;
    font-weight: 600;
    color: #241432;
    padding: 4px 8px;
    margin: -4px -8px;
}

.cd-bonus-item .bonus-course-btn:hover span {
    color: #6D3DD2;
}

/* -------------------------------------------------------------------------
   2. MODAL BACKDROP & OVERLAY
   ------------------------------------------------------------------------- */
body.bonus-modal-open,
html.bonus-modal-open {
    overflow: hidden !important;
}

.bonus-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(18, 11, 32, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.bonus-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* -------------------------------------------------------------------------
   3. MODAL DIALOG CONTAINER
   ------------------------------------------------------------------------- */
.bonus-modal-dialog {
    width: 100%;
    max-width: 960px;
    max-height: 88vh;
    max-height: min(88vh, calc(100dvh - 3rem));
    display: flex;
    flex-direction: column;
    margin: auto;
    transform: scale(0.94) translateY(14px);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.bonus-modal-backdrop.is-open .bonus-modal-dialog {
    transform: scale(1) translateY(0);
}

.bonus-modal-content {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(206, 78, 222, 0.24);
    box-shadow: 0 24px 60px -10px rgba(49, 27, 23, 0.3),
                0 0 0 1px rgba(109, 61, 210, 0.08);
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    max-height: min(88vh, calc(100dvh - 3rem));
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* -------------------------------------------------------------------------
   4. MODAL HEADER
   ------------------------------------------------------------------------- */
.bonus-modal-header {
    position: relative;
    padding: 1.4rem 1.75rem 1.2rem;
    background: linear-gradient(135deg, #FAF4FF 0%, #F5ECFF 100%);
    border-bottom: 1px solid rgba(109, 61, 210, 0.12);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    flex-shrink: 0;
}

.bonus-modal-header-info {
    flex: 1;
    min-width: 0;
}

.bonus-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6D3DD2 0%, #CE4EDE 100%);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
    box-shadow: 0 3px 10px rgba(109, 61, 210, 0.22);
}

.bonus-modal-badge-icon {
    font-size: 0.82rem;
}

.bonus-modal-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #1e1b4b;
    margin: 0 0 0.25rem 0;
    line-height: 1.25;
}

.bonus-modal-subtitle {
    font-size: 0.86rem;
    color: #6E5E5B;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.bonus-modal-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bonus-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 999px;
    background: #ffffff;
    color: #6D3DD2;
    border: 1px solid rgba(109, 61, 210, 0.18);
    box-shadow: 0 1px 4px rgba(49, 27, 23, 0.04);
}

.bonus-meta-pill i {
    font-size: 0.75rem;
}

.bonus-meta-pill.pill-green {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.28);
}

.bonus-meta-pill.pill-gold {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.28);
}

/* Close Button */
.bonus-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(109, 61, 210, 0.18);
    color: #6D3DD2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(49, 27, 23, 0.06);
    outline: none;
}

.bonus-modal-close:hover {
    background: #6D3DD2;
    color: #ffffff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(109, 61, 210, 0.35);
}

.bonus-modal-close:focus-visible {
    box-shadow: 0 0 0 3px rgba(109, 61, 210, 0.4);
}

/* -------------------------------------------------------------------------
   5. NAVIGATION FILTER TABS (When multiple sections)
   ------------------------------------------------------------------------- */
.bonus-modal-nav {
    display: flex;
    gap: 0.45rem;
    padding: 0.75rem 1.75rem;
    background: #ffffff;
    border-bottom: 1px solid rgba(109, 61, 210, 0.08);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.bonus-modal-nav::-webkit-scrollbar {
    display: none;
}

.bonus-nav-tab {
    background: #FAF7FD;
    border: 1px solid rgba(109, 61, 210, 0.12);
    color: #554466;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    outline: none;
}

.bonus-nav-tab:hover {
    background: rgba(109, 61, 210, 0.08);
    color: #6D3DD2;
}

.bonus-nav-tab.is-active {
    background: #6D3DD2;
    color: #ffffff;
    border-color: #6D3DD2;
    box-shadow: 0 3px 10px rgba(109, 61, 210, 0.25);
}

/* -------------------------------------------------------------------------
   6. MODAL BODY & STRUCTURED TABLE
   ------------------------------------------------------------------------- */
.bonus-modal-body {
    padding: 1.4rem 1.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    outline: none;
}

/* Custom Sleek Scrollbar */
.bonus-modal-body::-webkit-scrollbar {
    width: 6px;
}

.bonus-modal-body::-webkit-scrollbar-track {
    background: #F8F4FC;
}

.bonus-modal-body::-webkit-scrollbar-thumb {
    background: rgba(109, 61, 210, 0.25);
    border-radius: 999px;
}

.bonus-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 61, 210, 0.45);
}

/* Loading & Empty States */
.bonus-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #6E5E5B;
    text-align: center;
}

.bonus-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(109, 61, 210, 0.15);
    border-top-color: #6D3DD2;
    border-radius: 50%;
    animation: bonusSpin 0.75s linear infinite;
    margin-bottom: 1rem;
}

@keyframes bonusSpin {
    to { transform: rotate(360deg); }
}

.bonus-loading-text {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0;
}

/* Section Blocks */
.bonus-section-block {
    margin-bottom: 2rem;
    animation: bonusFadeSlideUp 0.3s ease-out forwards;
}

.bonus-section-block:last-child {
    margin-bottom: 0.5rem;
}

@keyframes bonusFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bonus-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(109, 61, 210, 0.12);
}

.bonus-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bonus-section-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(109, 61, 210, 0.12) 0%, rgba(206, 78, 222, 0.12) 100%);
    color: #6D3DD2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bonus-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e1b4b;
    margin: 0;
    line-height: 1.3;
}

.bonus-section-count {
    font-size: 0.74rem;
    font-weight: 700;
    color: #6D3DD2;
    background: rgba(109, 61, 210, 0.08);
    border: 1px solid rgba(109, 61, 210, 0.15);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* Table Wrapper & Styling */
.bonus-table-wrapper {
    border-radius: 14px;
    border: 1px solid rgba(109, 61, 210, 0.14);
    overflow-x: auto;
    overflow-y: hidden;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(49, 27, 23, 0.03);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    position: relative;
    max-width: 100%;
}

/* Horizontal scrollbar styling for the table wrapper */
.bonus-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.bonus-table-wrapper::-webkit-scrollbar-track {
    background: #FAF7FD;
    border-radius: 999px;
}

.bonus-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(109, 61, 210, 0.28);
    border-radius: 999px;
}

.bonus-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 61, 210, 0.45);
}

.bonus-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.86rem;
}

.bonus-table thead {
    background: #FAF7FD;
    border-bottom: 1px solid rgba(109, 61, 210, 0.14);
}

.bonus-table th {
    padding: 0.85rem 1rem;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5b4a70;
    white-space: nowrap;
}

.bonus-table tbody tr {
    border-bottom: 1px solid rgba(109, 61, 210, 0.07);
    transition: background-color 0.15s ease;
}

.bonus-table tbody tr:last-child {
    border-bottom: none;
}

.bonus-table tbody tr:hover {
    background-color: rgba(206, 78, 222, 0.035);
}

.bonus-table td {
    padding: 0.95rem 1rem;
    vertical-align: top;
    color: #311B17;
    line-height: 1.45;
}

/* Column specifics */
.bonus-table .th-num,
.bonus-table .td-num {
    width: 48px;
    min-width: 44px;
    text-align: center;
    padding-right: 0.4rem;
    position: sticky;
    left: 0;
    z-index: 2;
    background: #ffffff;
}

.bonus-table .th-num {
    z-index: 3;
    background: #FAF7FD;
}

.bonus-table tbody tr:hover .td-num {
    background: #FAF7FD;
}

.item-badge-num {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 6px;
    background: #F3EDFC;
    color: #6D3DD2;
    font-size: 0.74rem;
    font-weight: 800;
    text-align: center;
}

.bonus-table .th-module,
.bonus-table .td-module {
    width: 26%;
    min-width: 175px;
}

.module-title-cell {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.module-bullet-icon {
    color: #CE4EDE;
    font-size: 0.8rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.module-cell-name {
    font-weight: 700;
    color: #1e1b4b;
    font-size: 0.87rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

.bonus-table .th-topic,
.bonus-table .td-topic {
    width: 36%;
    min-width: 220px;
}

.topic-cell-desc {
    margin: 0;
    color: #4a403d;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
}

.bonus-table .th-outcomes,
.bonus-table .td-outcomes {
    width: 38%;
    min-width: 230px;
}

.outcomes-cell-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(34, 197, 94, 0.07);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 0.81rem;
    color: #166534;
    line-height: 1.38;
    word-break: break-word;
    overflow-wrap: break-word;
}

.outcomes-check-icon {
    color: #16a34a;
    margin-top: 2px;
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* Touch scroll notice for mobile */
.bonus-table-hint {
    display: none;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6D3DD2;
    margin-top: 0.45rem;
    text-align: right;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.bonus-table-hint i {
    font-size: 0.72rem;
    color: #CE4EDE;
    animation: bonusSwipePulse 1.8s ease-in-out infinite;
}

@keyframes bonusSwipePulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* -------------------------------------------------------------------------
   7. MODAL FOOTER
   ------------------------------------------------------------------------- */
.bonus-modal-footer {
    padding: 1rem 1.75rem;
    background: #FAF7FD;
    border-top: 1px solid rgba(109, 61, 210, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-shrink: 0;
}

.bonus-modal-footer-note {
    font-size: 0.82rem;
    color: #6E5E5B;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

.bonus-modal-footer-note strong {
    color: #6D3DD2;
}

.text-purple {
    color: #6D3DD2;
}

.bonus-modal-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.btn-bonus-secondary {
    background: #ffffff;
    border: 1px solid rgba(109, 61, 210, 0.25);
    color: #6D3DD2;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.btn-bonus-secondary:hover {
    background: rgba(109, 61, 210, 0.08);
    border-color: #6D3DD2;
}

.btn-bonus-primary {
    background: linear-gradient(135deg, #6D3DD2 0%, #CE4EDE 100%);
    border: none;
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(109, 61, 210, 0.35);
}

.btn-bonus-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(109, 61, 210, 0.45);
    color: #ffffff;
}

/* -------------------------------------------------------------------------
   8. RESPONSIVE BREAKPOINTS (Desktop, Tablet, Mobile)
   ------------------------------------------------------------------------- */

/* Tablet Landscape & Medium Desktops (<= 1024px) */
@media (max-width: 1024px) {
    .bonus-modal-dialog {
        max-width: min(880px, 94vw);
        max-height: min(90vh, calc(100dvh - 2.5rem));
    }

    .bonus-modal-content {
        max-height: min(90vh, calc(100dvh - 2.5rem));
    }

    .bonus-modal-header {
        padding: 1.25rem 1.5rem 1.05rem;
    }

    .bonus-modal-title {
        font-size: 1.32rem;
    }

    .bonus-modal-body {
        padding: 1.25rem 1.5rem;
    }

    .bonus-modal-footer {
        padding: 0.95rem 1.5rem;
    }

    .bonus-table {
        min-width: 620px;
    }
}

/* Tablet Portrait & Large Handhelds (<= 768px) */
@media (max-width: 768px) {
    .bonus-modal-backdrop {
        padding: 0.75rem;
    }

    .bonus-modal-dialog {
        max-width: 100%;
        max-height: min(92vh, calc(100dvh - 1.5rem));
    }

    .bonus-modal-content {
        border-radius: 18px;
        max-height: min(92vh, calc(100dvh - 1.5rem));
    }

    .bonus-modal-header {
        padding: 1.15rem 1.25rem 0.95rem;
        gap: 0.75rem;
    }

    .bonus-modal-title {
        font-size: 1.22rem;
    }

    .bonus-modal-subtitle {
        font-size: 0.82rem;
        margin-bottom: 0.5rem;
    }

    .bonus-meta-pill {
        font-size: 0.72rem;
        padding: 3px 9px;
    }

    .bonus-modal-nav {
        padding: 0.55rem 1.25rem;
    }

    .bonus-nav-tab {
        font-size: 0.73rem;
        padding: 5px 12px;
    }

    .bonus-modal-body {
        padding: 1.1rem 1.25rem;
    }

    .bonus-section-block {
        margin-bottom: 1.5rem;
    }

    .bonus-section-header {
        margin-bottom: 0.65rem;
        padding-bottom: 0.4rem;
        gap: 0.75rem;
    }

    .bonus-section-title {
        font-size: 0.98rem;
    }

    .bonus-section-count {
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    .bonus-table {
        min-width: 580px;
        font-size: 0.84rem;
    }

    .bonus-table th {
        padding: 0.75rem 0.85rem;
        font-size: 0.72rem;
    }

    .bonus-table td {
        padding: 0.85rem 0.85rem;
    }

    .bonus-table .th-num,
    .bonus-table .td-num {
        width: 40px;
        min-width: 40px;
    }

    .bonus-table .th-module,
    .bonus-table .td-module {
        min-width: 155px;
        width: 155px;
    }

    .bonus-table .th-topic,
    .bonus-table .td-topic {
        min-width: 195px;
        width: 195px;
    }

    .bonus-table .th-outcomes,
    .bonus-table .td-outcomes {
        min-width: 190px;
        width: 190px;
    }

    .bonus-table-hint {
        display: flex;
    }

    .bonus-modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.9rem 1.25rem;
    }

    .bonus-modal-footer-note {
        font-size: 0.78rem;
        text-align: left;
    }

    .bonus-modal-footer-actions {
        width: 100%;
        display: flex;
        gap: 0.6rem;
    }

    .bonus-modal-footer-actions .btn-bonus-secondary,
    .bonus-modal-footer-actions .btn-bonus-primary {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 0.55rem 1rem;
    }
}

/* Mobile Devices (<= 480px, including 430px and 375px) */
@media (max-width: 480px) {
    .bonus-modal-backdrop {
        padding: 0.5rem;
    }

    .bonus-modal-dialog {
        max-height: min(94vh, calc(100dvh - 1rem));
    }

    .bonus-modal-content {
        border-radius: 16px;
        max-height: min(94vh, calc(100dvh - 1rem));
    }

    .bonus-modal-header {
        padding: 0.95rem 1rem 0.85rem;
        gap: 0.65rem;
    }

    .bonus-modal-badge {
        font-size: 0.65rem;
        padding: 3px 9px;
        letter-spacing: 0.3px;
        margin-bottom: 0.35rem;
    }

    .bonus-modal-title {
        font-size: 1.08rem;
        line-height: 1.25;
    }

    .bonus-modal-subtitle {
        font-size: 0.76rem;
        margin-bottom: 0.45rem;
        line-height: 1.35;
    }

    .bonus-modal-close {
        width: 34px;
        height: 34px;
        font-size: 0.92rem;
        flex-shrink: 0;
    }

    .bonus-modal-meta-pills {
        gap: 0.35rem;
    }

    .bonus-meta-pill {
        font-size: 0.68rem;
        padding: 3px 8px;
        gap: 4px;
    }

    .bonus-meta-pill i {
        font-size: 0.68rem;
    }

    .bonus-modal-nav {
        padding: 0.45rem 1rem;
        gap: 0.35rem;
    }

    .bonus-nav-tab {
        font-size: 0.7rem;
        padding: 4px 10px;
        gap: 4px;
        flex-shrink: 0;
    }

    .bonus-modal-body {
        padding: 0.85rem 1rem;
    }

    .bonus-section-block {
        margin-bottom: 1.25rem;
    }

    .bonus-section-header {
        gap: 0.5rem;
        margin-bottom: 0.55rem;
        padding-bottom: 0.4rem;
    }

    .bonus-section-title {
        font-size: 0.92rem;
    }

    .bonus-section-icon {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .bonus-section-count {
        font-size: 0.68rem;
        padding: 2px 7px;
    }

    /* Mobile Table Structure & Sizing */
    .bonus-table-wrapper {
        border-radius: 12px;
    }

    .bonus-table {
        min-width: 550px;
        font-size: 0.8rem;
    }

    .bonus-table th {
        padding: 0.7rem 0.75rem;
        font-size: 0.7rem;
        letter-spacing: 0.3px;
    }

    .bonus-table td {
        padding: 0.75rem 0.75rem;
    }

    .bonus-table .th-num,
    .bonus-table .td-num {
        width: 38px;
        min-width: 38px;
        padding: 0.75rem 0.25rem;
        box-shadow: 2px 0 6px -2px rgba(109, 61, 210, 0.12);
    }

    .item-badge-num {
        width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: 0.68rem;
        border-radius: 5px;
    }

    .bonus-table .th-module,
    .bonus-table .td-module {
        min-width: 140px;
        width: 140px;
    }

    .module-title-cell {
        gap: 6px;
    }

    .module-bullet-icon {
        font-size: 0.72rem;
        margin-top: 2px;
    }

    .module-cell-name {
        font-size: 0.82rem;
    }

    .bonus-table .th-topic,
    .bonus-table .td-topic {
        min-width: 185px;
        width: 185px;
    }

    .topic-cell-desc {
        font-size: 0.78rem;
        line-height: 1.4;
    }

    .bonus-table .th-outcomes,
    .bonus-table .td-outcomes {
        min-width: 185px;
        width: 185px;
    }

    .outcomes-cell-box {
        padding: 0.4rem 0.55rem;
        font-size: 0.76rem;
        border-radius: 7px;
        gap: 6px;
    }

    .outcomes-check-icon {
        font-size: 0.76rem;
        margin-top: 1px;
    }

    .bonus-table-hint {
        display: flex;
        font-size: 0.69rem;
        margin-top: 0.35rem;
    }

    .bonus-modal-footer {
        padding: 0.75rem 1rem;
        gap: 0.65rem;
    }

    .bonus-modal-footer-note {
        font-size: 0.74rem;
        line-height: 1.35;
        gap: 6px;
    }

    .bonus-modal-footer-actions {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }

    .bonus-modal-footer-actions .btn-bonus-secondary {
        flex: 0 0 auto;
        padding: 0.5rem 0.9rem;
        font-size: 0.78rem;
        min-height: 38px;
    }

    .bonus-modal-footer-actions .btn-bonus-primary {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 1rem;
        font-size: 0.78rem;
        min-height: 38px;
    }

    .bonus-view-pill {
        display: none;
    }
}

/* Small / Ultra-Narrow Mobile (<= 360px, down to 320px) */
@media (max-width: 360px) {
    .bonus-modal-backdrop {
        padding: 0.35rem;
    }

    .bonus-modal-dialog {
        max-height: calc(100dvh - 0.7rem);
    }

    .bonus-modal-content {
        border-radius: 14px;
        max-height: calc(100dvh - 0.7rem);
    }

    .bonus-modal-header {
        padding: 0.8rem 0.75rem 0.7rem;
        gap: 0.5rem;
    }

    .bonus-modal-badge {
        font-size: 0.58rem;
        padding: 2px 7px;
        letter-spacing: 0.2px;
        margin-bottom: 0.3rem;
    }

    .bonus-modal-title {
        font-size: 0.98rem;
    }

    .bonus-modal-subtitle {
        font-size: 0.72rem;
        margin-bottom: 0.35rem;
        line-height: 1.3;
    }

    .bonus-modal-close {
        width: 30px;
        height: 30px;
        font-size: 0.82rem;
    }

    .bonus-modal-meta-pills {
        gap: 0.25rem;
    }

    .bonus-meta-pill {
        font-size: 0.64rem;
        padding: 2px 6px;
        gap: 3px;
    }

    .bonus-modal-nav {
        padding: 0.4rem 0.75rem;
        gap: 0.3rem;
    }

    .bonus-nav-tab {
        font-size: 0.66rem;
        padding: 3px 8px;
    }

    .bonus-modal-body {
        padding: 0.7rem 0.75rem;
    }

    .bonus-section-header {
        gap: 0.4rem;
        margin-bottom: 0.45rem;
        padding-bottom: 0.35rem;
    }

    .bonus-section-title {
        font-size: 0.88rem;
    }

    .bonus-section-icon {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .bonus-section-count {
        font-size: 0.65rem;
        padding: 1px 6px;
    }

    .bonus-table {
        min-width: 510px;
        font-size: 0.76rem;
    }

    .bonus-table th {
        padding: 0.6rem 0.65rem;
        font-size: 0.67rem;
    }

    .bonus-table td {
        padding: 0.65rem 0.65rem;
    }

    .bonus-table .th-num,
    .bonus-table .td-num {
        width: 34px;
        min-width: 34px;
        padding: 0.65rem 0.2rem;
    }

    .item-badge-num {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 0.64rem;
    }

    .bonus-table .th-module,
    .bonus-table .td-module {
        min-width: 130px;
        width: 130px;
    }

    .module-cell-name {
        font-size: 0.78rem;
    }

    .bonus-table .th-topic,
    .bonus-table .td-topic {
        min-width: 170px;
        width: 170px;
    }

    .topic-cell-desc {
        font-size: 0.74rem;
    }

    .bonus-table .th-outcomes,
    .bonus-table .td-outcomes {
        min-width: 175px;
        width: 175px;
    }

    .outcomes-cell-box {
        padding: 0.35rem 0.45rem;
        font-size: 0.72rem;
    }

    .bonus-modal-footer {
        padding: 0.65rem 0.75rem;
        gap: 0.5rem;
    }

    .bonus-modal-footer-note {
        font-size: 0.7rem;
        line-height: 1.3;
        gap: 5px;
    }

    .bonus-modal-footer-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.45rem;
    }

    .bonus-modal-footer-actions .btn-bonus-primary {
        width: 100%;
        justify-content: center;
        padding: 0.55rem 0.8rem;
        font-size: 0.78rem;
        order: 1;
    }

    .bonus-modal-footer-actions .btn-bonus-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.5rem 0.8rem;
        font-size: 0.78rem;
        order: 2;
    }
}

/* Mobile Landscape (Short Viewports <= 540px) */
@media (max-height: 540px) and (orientation: landscape) {
    .bonus-modal-backdrop {
        padding: 0.35rem;
    }

    .bonus-modal-dialog {
        max-height: calc(100dvh - 0.7rem);
    }

    .bonus-modal-content {
        max-height: calc(100dvh - 0.7rem);
        border-radius: 14px;
    }

    .bonus-modal-header {
        padding: 0.6rem 1rem 0.5rem;
        gap: 0.5rem;
    }

    .bonus-modal-badge {
        display: none;
    }

    .bonus-modal-title {
        font-size: 1.05rem;
        margin-bottom: 0.15rem;
    }

    .bonus-modal-subtitle {
        display: none;
    }

    .bonus-modal-meta-pills {
        gap: 0.3rem;
    }

    .bonus-meta-pill {
        font-size: 0.65rem;
        padding: 2px 7px;
    }

    .bonus-modal-nav {
        padding: 0.35rem 1rem;
    }

    .bonus-modal-body {
        padding: 0.75rem 1rem;
    }

    .bonus-modal-footer {
        padding: 0.5rem 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .bonus-modal-footer-note {
        font-size: 0.72rem;
    }

    .bonus-modal-footer-actions {
        width: auto;
    }

    .bonus-modal-footer-actions .btn-bonus-secondary,
    .bonus-modal-footer-actions .btn-bonus-primary {
        padding: 0.4rem 0.85rem;
        font-size: 0.76rem;
        min-height: 34px;
    }
}
