/**
 * ExamExplore — reliable responsive layout (explicit media queries).
 * Many Blade templates use Tailwind responsive classes that are not in examexplore-utilities.css.
 * This file mirrors the main-nav approach: no dependency on missing md:/lg: utilities.
 */

/* ----- Spacing / type helpers missing from utilities build ----- */
.pt-28 {
    padding-top: 7rem;
}

@media (min-width: 768px) {
    .md\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
    .md\:py-14 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
    .md\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
    .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
    .md\:pt-32 { padding-top: 8rem; }
    .md\:mb-8 { margin-bottom: 2rem; }
    .md\:mb-12 { margin-bottom: 3rem; }
    .md\:gap-5 { gap: 1.25rem; }
    .md\:gap-6 { gap: 1.5rem; }
    .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-5xl { font-size: 3rem; line-height: 1.1; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
}

@media (min-width: 1024px) {
    .lg\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
    .lg\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .lg\:text-5xl { font-size: 3rem; line-height: 1.1; }
    .lg\:space-y-0 > * + * { margin-top: 0; }
}

@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:gap-4 { gap: 1rem; }
    .sm\:inline { display: inline !important; }
    .sm\:items-end { align-items: flex-end; }
    .sm\:justify-between { justify-content: space-between; }
}

/* ----- Grid columns ----- */
.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:flex-row { flex-direction: row !important; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:flex-row { flex-direction: row !important; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:flex-row { flex-direction: row !important; }
    .lg\:items-end { align-items: flex-end; }
    .lg\:justify-between { justify-content: space-between; }
    .lg\:block { display: block !important; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ----- Flex column default (stack on mobile) ----- */
.flex-col {
    flex-direction: column;
}

/* ----- Public site: fixed nav + hero spacing ----- */
#app > main {
    padding-top: 0;
    overflow-x: hidden;
}

html {
    scroll-padding-top: calc(var(--ee-main-nav-height, 4rem) + 0.5rem);
}

#app > main > .ee-home-hero,
#app > main > .ee-page-hero {
    padding-top: calc(var(--ee-main-nav-height, 4rem) + clamp(1.25rem, 4vw, 2.5rem));
}

/* Catalog heroes (.ee-subcategories-hero) include nav offset on the section itself */

/* Pages without a full-width hero still need space below fixed nav */
#app > main > *:first-child:not(.ee-home-hero):not(.ee-page-hero):not(.ee-subcategories-hero) {
    padding-top: var(--ee-main-nav-height, 4rem);
}

#app .ee-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.875rem;
    width: 100%;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    #app .ee-hero-actions {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        max-width: none;
        width: auto;
    }

    #app .ee-hero-actions .ee-hero-btn {
        width: auto;
        min-width: 10.5rem;
    }
}

/* Catalog grids — same 4-up layout on exam listing and inner subcategory pages */
#dynamicCategoriesContainer,
#dynamicSubcategoriesContainer,
#dynamicExamsContainer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
}

@media (min-width: 640px) {
    #dynamicCategoriesContainer,
    #dynamicSubcategoriesContainer,
    #dynamicExamsContainer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    #dynamicCategoriesContainer,
    #dynamicSubcategoriesContainer,
    #dynamicExamsContainer {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 1280px) {
    #dynamicCategoriesContainer,
    #dynamicSubcategoriesContainer,
    #dynamicExamsContainer {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

#dynamicCategoriesContainer > .category-card,
#dynamicCategoriesContainer > .subcategory-card,
#dynamicSubcategoriesContainer > .subcategory-card,
#dynamicExamsContainer > .subcategory-card {
    min-width: 0;
}

/* Exam detail page — "What to expect" start card */
.ee-exam-expect-card {
    max-width: 36rem;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 1.5rem;
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 1.25rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.ee-exam-expect-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.ee-exam-expect-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    color: #3b82f6;
    font-size: 1.05rem;
}

.ee-exam-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ee-exam-status-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: #22c55e;
}

.ee-exam-expect-title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.25;
    color: #111827;
}

.ee-exam-expect-lead {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #6b7280;
}

.ee-exam-expect-details {
    border: 1px solid #e8eef5;
    border-radius: 1rem;
    background: #fbfdff;
    overflow: hidden;
    margin-bottom: 0.85rem;
}

.ee-exam-expect-details-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ee-exam-expect-details-head i {
    color: #93c5fd;
}

.ee-exam-expect-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ee-exam-expect-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid #eef2f7;
    font-size: 0.875rem;
}

.ee-exam-expect-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    min-width: 0;
}

.ee-exam-expect-label i {
    width: 1rem;
    text-align: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.ee-exam-expect-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    white-space: nowrap;
}

.ee-exam-expect-value.is-pass {
    color: #16a34a;
}

.ee-exam-expect-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    background: #fff7ed;
    color: #ea580c;
}

.ee-exam-expect-chip.is-easy {
    background: #ecfdf5;
    color: #059669;
}

.ee-exam-expect-chip.is-hard {
    background: #fef2f2;
    color: #dc2626;
}

.ee-exam-expect-tips {
    padding: 0.9rem 1rem;
    border: 1px solid #dbeafe;
    border-radius: 0.9rem;
    background: #f5f9ff;
    margin-bottom: 1.35rem;
}

.ee-exam-expect-tips-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.3rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e3a8a;
}

.ee-exam-expect-tips-title i {
    color: #60a5fa;
}

.ee-exam-expect-tips p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #64748b;
}

.ee-exam-expect-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.ee-exam-guest-note {
    margin: 0 0 0.85rem;
    font-size: 0.8125rem;
    color: #94a3b8;
    text-align: center;
}

.ee-exam-action-row {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
}

.ee-exam-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    min-width: 6.25rem;
    min-height: 2.85rem;
    padding: 0.75rem 1rem;
    border-radius: 0.7rem;
    border: 1px solid #dbe3f0;
    background: #fff;
    color: #334155;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ee-exam-back-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.ee-exam-back-btn i {
    font-size: 0.8rem;
}

.ee-exam-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 2.85rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.7rem;
    background: #2563eb;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, transform 0.15s ease;
}

.ee-exam-start-btn:hover {
    background: #1d4ed8;
    color: #fff;
}

.ee-exam-start-btn i {
    font-size: 0.8rem;
}

.ee-exam-guest-link {
    display: block;
    margin-top: 0.85rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.ee-exam-guest-link:hover {
    color: #1d4ed8;
}

@media (max-width: 640px) {
    .ee-exam-expect-card {
        padding: 1.35rem 1.1rem 1.15rem;
        border-radius: 1rem;
    }

    .ee-exam-expect-title {
        font-size: 1.3rem;
    }

    .ee-exam-expect-list li {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .ee-exam-expect-value,
    .ee-exam-expect-chip {
        margin-left: auto;
    }
}

/* Category inner hero — responsive sizing */
@media (max-width: 767px) {
    .ee-subcategories-hero-meta {
        margin-left: 0;
        justify-content: flex-start;
        width: 100%;
    }
}

@media (min-width: 768px) {
    .ee-subcategories-hero-inner {
        padding-bottom: 1.25rem;
    }

    .ee-subcategories-hero-icon {
        width: 3.25rem;
        height: 3.25rem;
        font-size: 1.2rem;
    }

    .ee-subcategories-hero-title {
        font-size: 1.0rem;
    }

    .ee-subcategories-hero-desc {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .ee-subcategories-hero-main {
        gap: 1.25rem;
    }

    .ee-subcategories-hero-title {
        font-size: 1.0rem;
    }
}

/* Home hero: single column on mobile, two columns desktop */
#app .ee-home-hero .grid.lg\:grid-cols-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

@media (min-width: 1024px) {
    #app .ee-home-hero .grid.lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4rem;
        align-items: center;
    }

    #app .ee-home-hero .hidden.lg\:block {
        display: block !important;
    }
}

/* Home stats row */
#app .ee-home-hero .grid.grid-cols-1.md\:grid-cols-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    #app .ee-home-hero .grid.grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

/* Features section grid */
#app .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    #app .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    #app .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Footer */
footer.ee-site-footer .grid.md\:grid-cols-5 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    footer.ee-site-footer .grid.md\:grid-cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    footer.ee-site-footer .md\:col-span-2 {
        grid-column: span 2;
    }
}

@media (min-width: 1024px) {
    footer.ee-site-footer .grid.md\:grid-cols-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

footer.ee-site-footer .flex.flex-col.lg\:flex-row {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start;
}

@media (min-width: 1024px) {
    footer.ee-site-footer .flex.flex-col.lg\:flex-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Container — prevent horizontal scroll on small screens */
#app .container {
    width: 100%;
    max-width: 100%;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
    /* Preserve vertical padding when combined with hero/section classes */
}

@media (min-width: 640px) {
    #app .container {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 768px) {
    #app .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    #app .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    #app .container {
        max-width: 1280px;
    }
}

/* Panel topnav: show wordmark from sm+ (hidden when sidebar is collapsed) */
@media (min-width: 640px) {
    #admin-body .student-topnav-brand .ee-topnav-brand-text,
    #student-body .student-topnav-brand .ee-topnav-brand-text,
    #admin-body .student-topnav-brand .hidden.sm\:inline,
    #student-body .student-topnav-brand .hidden.sm\:inline {
        display: inline !important;
    }

    #admin-body [data-panel-profile-menu-btn] .hidden.sm\:block,
    #student-body [data-panel-profile-menu-btn] .hidden.sm\:block {
        display: block !important;
    }
}

@media (min-width: 1024px) {
    #admin-body.sidebar-collapsed .student-topnav .ee-topnav-brand-text,
    #student-body.sidebar-collapsed .student-topnav .ee-topnav-brand-text {
        display: none !important;
    }
}

/* Panel sidebar footer collapse — desktop only */
@media (min-width: 1024px) {
    #admin-sidebar .sidebar-link.hidden.lg\:flex,
    #student-sidebar .sidebar-link.hidden.lg\:flex {
        display: flex !important;
    }
}

/* Breadcrumb wrap on small screens */
.ee-breadcrumb-light ol,
.breadcrumb-list {
    flex-wrap: wrap;
    row-gap: 0.35rem;
}

/* Cards / CTAs on narrow screens */
@media (max-width: 639px) {
    .category-card,
    .subcategory-card {
        padding: 0.875rem;
    }

    #app .ee-cta-slab {
        padding: 2.5rem 0;
    }

    .ee-cta-slab-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .ee-cta-slab-desc {
        font-size: 0.9375rem;
    }

    .ee-cta-slab-perks {
        flex-direction: column;
        gap: 0.35rem;
    }

    .ee-cta-slab-actions .ee-hero-btn {
        width: 100%;
        max-width: 20rem;
    }

    .navigation-bar .btn-primary span,
    .navigation-bar .btn-secondary span {
        white-space: nowrap;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .main-nav-mobile-panel {
        padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
    }
}
