/* ============================================================
   Responsive Layout - Desktop + Mobile
   ============================================================ */

/* --- Hamburger menu trigger (hidden by default, shown on mobile) --- */
.nav-trigger {
    position: absolute;
    clip: rect(0, 0, 0, 0);
}

label[for="nav-trigger"] {
    display: none;
}

.mobile-header {
    display: none;
}

/* ============================================================
   DESKTOP STYLES (769px and above)
   ============================================================ */
#container {
    display: flex;
    border-radius: 10px;
    background-color: #000;
    padding: 3px 3px 3px 3px;
    margin: 18px auto 0 auto;
    width: 635px;
    position: relative;
}

#container #logo {
    position: absolute;
    top: -20px;
    left: 0;
    background-image: url(/content/images/pvscb_logo.png);
    width: 135px;
    height: 142px;
}

#container #contentContainer {
    border-radius: 10px;
    background-color: #fff;
    padding: 10px 20px 20px 20px;
    -ms-flex: 10;
    -webkit-flex: 10;
    flex: 10;
    min-width: 0;
    overflow: hidden;
}

#container #leftNavContainer {
    margin-top: 130px;
    padding: 0 10px 25px 0;
    color: #fff;
    font-size: larger;
    -ms-flex: 2;
    -webkit-flex: 2;
    flex: 2;
}

#contentContainer h1:first-child {
    font-family: Onani;
    font-size: 23px;
    text-align: right;
    white-space: nowrap;
    text-shadow: 5px 5px 10px #808080;
    margin: 10px 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #000;
    box-shadow: 0 10px 10px -9px #808080;
}

.nav-cta {
    position: sticky;
    top: 10px;
    display: block;
    background: #FF9900;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-family: Onani;
    font-size: 10pt;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 12px 0 4px;
    transition: background-color 0.15s;
}

.nav-cta:link,
.nav-cta:visited {
    color: #fff;
    text-decoration: none;
}

.nav-cta:hover {
    background: #e08800;
}

#leftNavContainer a:hover,
#leftNavContainer .nav-logoff:hover {
    color: #FF9900;
    background-color: #4e4d4d;
    border-radius: 5px;
    margin-bottom: 2px;
}

#leftNavContainer a.active {
    color: #FF9900;
    background-color: #4e4d4d;
    border-radius: 5px;
    margin-bottom: 2px;
}

footer {
    width: 500px;
    margin: 10px auto;
    text-align: center;
}

footer p {
    margin: 5px 0;
    font-size: smaller;
}

/* --- Mobile-only Get Certified button (hidden on desktop) --- */
.mobile-cta {
    display: none;
}

@media (max-width: 768px) {
    .mobile-cta {
        display: block;
        background: #333;
        color: #fff;
        text-decoration: none;
        font-family: Onani;
        font-size: 16pt;
        letter-spacing: 0.5px;
        padding: 12px 20px;
        border-radius: 6px;
        border: 2px solid #FF9900;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
        z-index: 100;
        transition: background-color 0.15s;
        /* Default: static, centered below footer */
        text-align: center;
        margin: 20px auto;
        width: fit-content;
    }

    .mobile-cta-fixed {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
    }

    .mobile-cta:link,
    .mobile-cta:visited {
        color: #fff;
        text-decoration: none;
    }

    .mobile-cta:hover {
        background: #444;
    }
}

/* ============================================================
   MOBILE STYLES (768px and below)
   ============================================================ */
@media (max-width: 768px) {

    /* --- Global mobile resets --- */
    * {
        box-sizing: border-box !important;
    }

    /* --- Hamburger menu button (CSS-only) --- */
    label[for="nav-trigger"] {
        display: block;
        position: fixed;
        left: 10px;
        top: 8px;
        z-index: 11;
        height: 36px;
        width: 36px;
        cursor: pointer;
        font-size: 28px;
        line-height: 36px;
        color: #FF9900;
        text-align: center;
        background: none;
    }

    label[for="nav-trigger"]::before {
        content: "\2630";
    }

    /* --- Navigation overlay --- */
    #container #leftNavContainer {
        position: fixed;
        top: 0;
        left: 0;
        width: 200px;
        height: 100%;
        background: #111;
        z-index: 10;
        margin-top: 0;
        padding: 60px 10px 25px 10px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        overflow-y: auto;
        flex: none;
    }

    #container #leftNavContainer a,
    #container #leftNavContainer .nav-logoff {
        display: block;
        font-size: 18px;
        margin-bottom: 5px;
        padding: 2px;
    }

    #container #leftNavContainer a.active {
        color: #FF9900;
        background-color: #4e4d4d;
        border-radius: 5px;
        margin-bottom: 15px;
    }

    /* --- When menu is open --- */
    .nav-trigger:checked ~ #container #leftNavContainer {
        transform: translateX(0) !important;
    }

    .nav-trigger:checked + label {
        left: 160px;
        top: 15px;
        color: #FF9900;
    }

    .nav-trigger:checked + label::before {
        content: "\2715";
    }

    /* --- Main container --- */
    #container {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        background-color: #fff;
    }

    #container #logo {
        display: none;
    }

    #container #contentContainer {
        padding: 85px 15px 20px 15px;
        border-radius: 0;
    }

    /* --- Form fields full width on mobile --- */
    #loginForm,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="month"],
    textarea,
    select {
        width: 100% !important;
    }

    /* --- Stack labels above fields on mobile --- */
    .form-group > label {
        display: block !important;
        width: auto !important;
        text-align: left !important;
    }

    .checkbox {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .form-group input[type="submit"],
    button,
    a.btn {
        margin-left: 0 !important;
        display: block;
        width: 100%;
        text-align: center;
    }

    /* --- Data grid: card layout on mobile --- */
    .Grid {
        box-shadow: none;
    }

    .Grid .GridHeader {
        display: none;
    }

    .Grid .GridItem,
    .Grid .GridAlternatingItem {
        display: block;
        border: 1px solid #ccc;
        border-left: 4px solid #FF9900;
        border-radius: 8px;
        padding: 12px 16px;
        margin-bottom: 12px;
        background: #fff !important;
    }

    .Grid .GridItem td,
    .Grid .GridAlternatingItem td {
        display: block;
        border: none !important;
        padding: 2px 0 !important;
        text-align: left;
    }

    /* --- Hide desktop h1 on mobile --- */
    #contentContainer h1:first-child {
        display: none;
    }

    /* --- Hide sidebar CTA on mobile (mobile-cta handles it) --- */
    .nav-cta {
        display: none;
    }

    /* --- Footer pad class added by JS when CTA is fixed --- */
    footer.mobile-cta-footer-pad {
        padding-bottom: 80px;
    }

    /* --- Mobile header bar --- */
    .mobile-header {
        display: flex;
        align-items: center;
        font: clamp(16px, 5vw, 24px)/1.2 Onani;
        color: #fff;
        background: #000;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 5;
        text-align: right;
        margin: 0;
        padding: 8px 15px 8px 50px;
    }

    .mobile-logo {
        height: 75px;
        width: auto;
        margin-left: 10px;
        flex-shrink: 0;
    }

    .mobile-header span {
        margin-left: auto;
        text-align: right;
    }

    /* --- Footer --- */
    footer {
        width: 100%;
        padding: 10px 15px;
    }

    /* --- Prevent horizontal scroll when menu animates --- */
    body {
        overflow-x: hidden;
    }

    /* --- Transition for hamburger label --- */
    .nav-trigger + label {
        transition: left 0.2s;
    }

    /* --- Stat cards stack on mobile --- */
    .stat-cards {
        flex-direction: column;
        gap: 12px;
    }

    /* --- Section headers larger on mobile --- */
    .section-header {
        font-size: 1.4rem;
    }

    /* --- Mobile landscape: boost title/header to keep up with text-size-adjust body scaling --- */
    @media (orientation: landscape) {
        .title {
            font-size: 2rem;
        }

        .section-header {
            font-size: 1.6rem;
        }
    }

    /* --- Callout box tighter on mobile --- */
    .callout-box {
        padding: 12px 14px;
    }

    /* --- Comparison table → cards on mobile --- */

    /* Hide the orange underline on the heading above cards */
    .comparison-table-section .section-header {
        border-bottom: none;
        padding-bottom: 0;
    }

    .table-scroll {
        overflow: visible;
        margin: 16px 0;
        padding: 0;
    }

    .comparison-table {
        min-width: 0;
    }

    .comparison-table thead {
        display: none;
    }

    .comparison-table tbody,
    .comparison-table tr,
    .table-scroll .comparison-table td,
    .table-scroll .comparison-table th {
        display: block;
        width: 100%;
    }

    .comparison-table tr {
        background: #fff;
        border: 1px solid #e8e8e8;
        border-left: 3px solid #FF9900;
        border-radius: 4px;
        padding: 12px 14px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    .comparison-table tr:nth-child(even) td {
        background: transparent;
    }

    /* Override .table-scroll td defaults (borders, nowrap) */
    .table-scroll .comparison-table td {
        border: none;
        white-space: normal;
    }

    /* Topic name as card header */
    .table-scroll .comparison-table td:first-child {
        font-size: 0.95rem;
        font-weight: 700;
        padding: 0 0 6px 0;
        border-bottom: 1px solid #eee;
        margin-bottom: 6px;
    }

    /* NFHS and PVSCB values */
    .table-scroll .comparison-table td:nth-child(2),
    .table-scroll .comparison-table td:nth-child(3) {
        padding: 3px 0;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .comparison-table td:nth-child(2)::before {
        content: "NFHS: ";
        font-weight: 700;
        color: #333;
    }

    .comparison-table td:nth-child(3)::before {
        content: "PVSCB: ";
        font-weight: 700;
        color: #333;
    }

}

/* ============================================================
   Test Pages — Status, Take, Results, History, Completed
   ============================================================ */

/* Status table */
.test-status-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.test-status-table th {
    background: #333;
    color: #fff;
    padding: 8px 10px;
    text-align: left;
    font-size: 0.85em;
}

.test-status-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.test-status-table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Badges — pill style matching old app */
.badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pass {
    background: #28a745;
    color: #fff;
}

.badge-fail {
    background: #ffe0e0;
    color: #c0392b;
    border: 1px solid #e6b0aa;
}

.badge-incomplete {
    background: #fff3d0;
    color: #665200;
    border: 1px solid #ffe0a0;
}

.badge-pending {
    background: #fff;
    color: #FF9900;
    border: 2px solid #FF9900;
}

.badge-expired {
    background: #ffe0e0;
    color: #c0392b;
    border: 1px solid #e6b0aa;
}

/* Action button overrides (base styles in layout-base.css) */
.btn-sm {
    padding: 6px 20px;
    font-size: 0.85em;
    margin: 3px;
    display: inline-block;
}

.btn-secondary,
.btn-secondary:hover {
    background: #666;
}

/* Stack Go/Study buttons vertically in status table */
.test-status-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.test-status-actions .btn-sm {
    min-width: 70px;
    text-align: center;
}

/* Take test page */
.test-alert {
    background: #fff8ee;
    border: 2px solid #FF9900;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 0.9em;
    font-weight: 700;
    font-style: italic;
    color: #FF9900;
}

.test-questions {
    margin: 15px 0;
}

.question-block {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 0 16px;
    background: #fff;
}

.question-text {
    display: flex;
    align-items: flex-start;
    font-weight: 700;
    margin: 0 0 10px;
    font-size: 1em;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FF9900;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85em;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.answer-list {
    padding: 0 0 0 36px;
}

.answer-list label {
    display: block;
    padding: 4px 0;
    cursor: pointer;
    font-size: 0.9em;
}

.answer-list input[type="radio"] {
    margin-right: 6px;
}

.test-buttons {
    margin: 15px 0;
    display: flex;
    gap: 10px;
}

.test-buttons button,
.test-buttons .btn {
    padding: 8px 24px;
    font-size: 0.9em;
}

/* Results page */
.results-score {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 1.2em;
    font-weight: 700;
    margin: 10px 0;
}

.results-pass {
    background: #28a745;
    color: #fff;
}

.results-fail {
    background: #ffe0e0;
    color: #c0392b;
    border: 2px solid #e6b0aa;
}

.missed-count {
    display: inline-block;
    margin: 12px 0 8px;
    padding: 4px 10px;
    font-size: 0.95em;
    background: #fff8ee;
    border: 1px solid #FF9900;
    border-radius: 4px;
    color: #FF9900;
}

.missed-count-fail {
    background: #ffe0e0;
    border-color: #e6b0aa;
    color: #c0392b;
}

.missed-question-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 0 16px;
    background: #fafafa;
}

.correct-answer {
    background: #d4edda;
    font-weight: 700;
    font-style: italic;
    padding: 3px 6px;
    border-radius: 3px;
}

/* History table */
.test-history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.test-history-table th {
    background: #333;
    color: #fff;
    padding: 8px 10px;
    text-align: left;
    font-size: 0.85em;
}

.test-history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    font-size: 0.85em;
}

.test-history-table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Renewal panel */
.renewal-panel {
    background: #fff8ee;
    border: 1px solid #FF9900;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 15px 0;
}

.renewal-panel h2 {
    font-size: 1em;
    color: #333;
    margin: 0 0 8px;
}

.renewal-panel ol {
    margin: 8px 0;
    padding: 0 0 0 20px;
    font-size: 0.85em;
}

/* ============================================================
   Secure Pages — Dashboard, Profile, Receipt, Support
   ============================================================ */

/* Dashboard status */
.status-current { color: #28a745; }
.status-expiring { color: #FF9900; }
.status-expired { color: #dc3545; }
.status-pending { color: #ffc107; }

.user-info {
    margin: 8px 0;
    font-size: 0.9em;
}

.user-info strong {
    display: inline-block;
    min-width: 120px;
}

/* Form styling for Profile, Payment, Account */
.form-group {
    margin: 0 0 10px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85em;
    margin: 0 0 3px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.85em;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #FF9900;
    outline: none;
}

.requiredLabel {
    font-weight: 700;
}

.requiredLabel::before {
    content: "*";
}

/* Receipt */
.receipt {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 16px;
    margin: 10px 0;
    background: #fafafa;
}

.receipt h2 {
    font-size: 0.95em;
    margin: 0 0 8px;
    border-bottom: 1px solid #ddd;
    padding: 0 0 6px;
}

/* Link button (styled like a link but behaves as button).
   Must override layout-base.css button/button:hover/button:active rules. */
.link-button,
.link-button:hover,
.link-button:active {
    background: none;
    border: none;
    box-shadow: none;
    color: #FF9900;
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
    padding: 0;
}

.link-button:hover {
    color: #e08800;
}

/* ============================================================
   Study Pages
   ============================================================ */

/* Study index page */
.study-menu {
    margin: 10px 0;
}

.study-menu-item {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #FF9900;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 0 0 10px;
}

.study-menu-item a {
    text-decoration: none;
    color: #333;
    font-size: 1em;
    font-weight: 700;
}

.study-menu-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.study-menu-item a:hover {
    color: #333;
}

.study-menu-item span {
    font-size: 1em;
    color: #333;
    font-weight: 700;
}

.study-parts {
    margin: 8px 0 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.study-parts .btn-sm {
    padding: 4px 14px;
    font-size: 0.8em;
}

.study-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #FF9900;
    margin: 10px 0 15px;
}

.study-tabs a {
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    text-decoration: none;
    color: #333;
    font-size: 0.85em;
    border-radius: 4px 4px 0 0;
    margin-right: -1px;
}

.study-tabs a.active {
    background: #FF9900;
    color: #fff;
    border-color: #FF9900;
}

.study-nav {
    margin: 15px 0;
    display: flex;
    gap: 10px;
}

/* Photo sequence lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: fixed;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    line-height: 1;
    box-shadow: none;
}

.lightbox-title {
    color: #FF9900;
    font-family: Onani;
    font-size: 1.2rem;
    margin: 10px 0 15px;
}

.lightbox-overlay img {
    max-width: 320px;
    margin: 5px 0;
    border-radius: 4px;
    cursor: default;
}

/* Wide table horizontal scroll */
.table-scroll {
    overflow-x: auto;
    max-width: 100%;
    margin: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.table-scroll table {
    border-collapse: collapse;
    font-size: 0.75em;
}

.table-scroll td,
.table-scroll th {
    border: 1px solid #999;
    padding: 3px 6px;
    white-space: nowrap;
}

/* Comparison table: override table-scroll nowrap, allow text wrap */
.table-scroll .comparison-table td,
.table-scroll .comparison-table th {
    white-space: normal;
}

.comparison-table {
    width: 100%;
    table-layout: fixed;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    width: 25%;
}

/* Study content images — constrain to container width */
#contentContainer img {
    max-width: 100%;
    height: auto;
}

.photo-sequence img {
    margin: 5px 0;
    border: 1px solid #ddd;
}

/* ============================================================
   Admin Pages
   ============================================================ */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.85em;
}

.admin-table th {
    background: #333;
    color: #fff;
    padding: 6px 8px;
    text-align: left;
}

.admin-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #ddd;
}

.admin-table tr:nth-child(even) {
    background: #f9f9f9;
}

.admin-table a {
    color: #FF9900;
}

/* Sort header links */
.sort-link {
    color: #fff;
    text-decoration: none;
}

.sort-link:hover {
    text-decoration: underline;
}

/* Success/error messages */
.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 0.85em;
}

.alert-error,
.validation-summary-errors {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 0.85em;
}

.validation-summary-errors ul {
    margin: 4px 0;
    padding: 0 0 0 18px;
}

/* ============================================================
   Checklist table (Get Started, etc.)
   ============================================================ */

.checklist-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.checklist-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    font-size: 0.95em;
    line-height: 1.5;
}

.checklist-table .check-icon {
    width: 30px;
    color: #2e7d32;
    font-size: 1.2em;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
}

.checklist-table .step-number {
    width: 30px;
    color: #FF9900;
    font-family: Onani;
    font-size: 1.3em;
    text-align: center;
    vertical-align: middle;
}

/* ============================================================
   Blog
   ============================================================ */

.blog-meta {
    font-size: 0.85em;
    color: #777;
    margin: -5px 0 20px;
}

.blog-list {
    margin: 20px 0;
}

a.blog-card,
a.blog-card:link,
a.blog-card:visited {
    display: block;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-left: 4px solid #FF9900;
    border-radius: 0 6px 6px 0;
    padding: 18px 20px;
    margin: 0 0 16px;
    text-decoration: none;
    color: #333;
    transition: box-shadow 0.15s, border-color 0.15s;
}

a.blog-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-left-color: #e08800;
    color: #333;
}

.blog-card h2 {
    font-family: Onani;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
    color: #333;
    margin: 0 0 4px;
}

.blog-card .blog-card-meta {
    font-size: 0.8em;
    color: #999;
    margin: 0 0 8px;
}

.blog-card p {
    font-size: 0.9em;
    line-height: 1.5;
    color: #333;
    margin: 0 0 8px;
}

.blog-card .blog-card-link {
    font-size: 0.85em;
    font-weight: 600;
    color: #FF9900;
}
