/* ═══════════════════════════════════════════════════════════
   Lumin — Internal Pages CSS
   Layouts for Platform, Teachers, Parents, and AI features
   ═══════════════════════════════════════════════════════════ */

.page-internal {
    background: #F4F6F9; /* Subtle gray background for internal pages like the mockups */
    color: var(--color-slate);
    padding-top: calc(var(--nav-height) + 60px);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Ensure nav is always visible on internal pages (no scroll trigger needed) */
.page-internal .nav--static {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 900px) {
    .page-internal .nav--static {
        background: rgba(255, 255, 255, 0.75);
    }
}

@media (max-width: 600px) {
    .page-internal .nav--static {
        background: rgba(255, 255, 255, 0.7);
    }
}

/* Footer on internal pages */
.page-internal .footer {
    margin-top: 60px;
}

/* ── Containers ─────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.container--narrow {
    max-width: 800px;
}

.section {
    padding: 60px 0;
}

.text-center { text-align: center; }

/* ── Typography ─────────────────────────────────────────── */
.eyebrow {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-blue);
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--color-navy);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    color: var(--color-slate);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 40px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

/* ── Grids ──────────────────────────────────────────────── */
.grid-4x {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
}

.grid-2x {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    align-items: start;
}

/* ── Cards (Matching UI Mockups) ────────────────────────── */
.card {
    background: var(--color-white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(10, 31, 68, 0.04);
    border: 1px solid rgba(10, 31, 68, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(10, 31, 68, 0.08);
}

.card__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 12px;
}

.card__desc {
    font-size: 0.9375rem;
    color: var(--color-slate);
    line-height: 1.6;
}

/* ── UI Mockup Elements ─────────────────────────────────── */

.ui-header {
    background: var(--color-white);
    border-radius: 12px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: #EBF4FC;
    color: var(--color-navy);
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info h2 {
    font-size: 1.25rem;
    color: var(--color-navy);
    line-height: 1.2;
    margin-bottom: 2px;
}

.user-info p {
    font-size: 0.875rem;
    color: #8C9BAB;
}

.status-badges {
    display: flex;
    gap: 12px;
}

.badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge--green { background: #E0F8EC; color: #1E9E63; }
.badge--yellow { background: #FFF5D1; color: #E5A31E; }
.badge--blue { background: #E6F3FF; color: var(--color-blue); }
.badge--red { background: #FEEDED; color: #D33D3D; }

/* ── Tabs ───────────────────────────────────────────────── */
.ui-tabs {
    background: var(--color-white);
    border-radius: 12px;
    display: flex;
    padding: 0 16px;
    margin-bottom: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #0A1F44 transparent;
}

.ui-tabs::-webkit-scrollbar {
    height: 1.5px;
}

.ui-tabs::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.ui-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.ui-tabs::-webkit-scrollbar-thumb {
    background: #0A1F44;
    border-radius: 0;
}

.ui-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--color-blue);
}

.tab {
    flex-shrink: 0;
    padding: 20px 24px;
    font-weight: 500;
    font-size: 0.9375rem;
    color: #8C9BAB;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--color-blue);
}

.tab.active {
    color: var(--color-navy);
    font-weight: 800;
}

/* ── Content Switching ──────────────────────────────────── */
.portfolio-content {
    display: none;
    animation: slideUpFade 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.portfolio-content.active {
    display: block;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Enhanced Card Layouts ─────────────────────────────── */
.feature-section {
    margin-bottom: 48px;
}

.feature-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(10, 31, 68, 0.08);
}

.card-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ui-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 48px;
}

.card--top {
    display: flex;
    flex-direction: column;
    justify-content: flex-start !important;
}

/* ── Bullet Points ──────────────────────────────────────── */
.bullet-list {
    list-style: none;
    padding: 0;
}

.bullet-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 0.9375rem;
    color: var(--color-slate);
}

.bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34C759; /* Green dot from AI report screenshot */
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - INTERNAL PAGES
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }
    
    .grid-2x {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .ui-card-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .page-internal {
        padding-top: calc(var(--nav-height) + 40px);
    }
    
    .container {
        padding: 0 24px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .grid-4x {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .grid-2x {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .card {
        padding: 24px;
    }
    
    .ui-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 24px;
    }
    
    .user-profile {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .status-badges {
        flex-wrap: wrap;
    }
    
    .ui-tabs {
        padding: 0 8px;
    }
    
    .tab {
        padding: 16px 20px;
        font-size: 0.875rem;
    }
    
    .ui-card-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }
    
    .section {
        padding: 32px 0;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        margin-bottom: 16px;
    }
    
    .hero-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 32px;
    }
    
    .section-title {
        font-size: 1.25rem;
        margin-bottom: 24px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card__title {
        font-size: 1.125rem;
    }
    
    .card__desc {
        font-size: 0.875rem;
    }
    
    .ui-header {
        padding: 16px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
    
    .user-info h2 {
        font-size: 1.125rem;
    }
    
    .user-info p {
        font-size: 0.8125rem;
    }
    
    .badge {
        padding: 4px 12px;
        font-size: 0.6875rem;
    }
    
    .tab {
        padding: 14px 16px;
        font-size: 0.8125rem;
    }
    
    .nav__cta {
        padding: 8px 18px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    /* Navigation fixes for very small screens */
    .nav {
        padding: 0 8px 0 2px !important;
    }
    
    .nav__inner {
        padding: 0 !important;
        gap: 8px !important;
    }
    
    .nav__brand {
        flex-shrink: 0;
    }
    
    .nav__logo-img {
        height: 34px !important;
    }
    
    .nav__toggle {
        width: 36px !important;
        height: 36px !important;
        padding: 6px !important;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .nav__toggle-bar {
        width: 20px !important;
        height: 2px !important;
    }
    
    .nav__cta {
        padding: 8px 16px !important;
        font-size: 0.75rem !important;
        white-space: nowrap;
    }
    
    /* Grid and layout fixes */
    .grid-4x {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr !important;
    }
    
    .ui-header {
        padding: 16px;
    }
    
    .user-profile {
        width: 100%;
    }
    
    .status-badges {
        width: 100%;
    }
    
    table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    table th,
    table td {
        padding: 12px 16px !important;
    }
    
    .card-group > .card {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 16px;
    }
    
    .card-group > .card button {
        width: 100%;
    }
    
    /* Make child selector cards stack on mobile */
    .child-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .child-card {
        width: 100%;
        max-width: 300px;
    }
    
    /* Responsive chat layout */
    .card[style*="grid-template-columns: 300px 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Make action buttons stack */
    div[style*="display: flex; gap: 16px"] button,
    div[style*="display: flex; gap: 12px"] button {
        flex: 1;
        min-width: 0;
    }
}


/* ═══════════════════════════════════════════════════════════
   ADDITIONAL RESPONSIVE UTILITIES
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Force responsive behavior for inline-styled grids */
    [style*="display: grid"][style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Specific fix for Chat/Sidebar layout found in Teachers/Admin */
    [style*="grid-template-columns: 300px 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Wrap tables to prevent layout breaking */
    .table-responsive, 
    div:has(> table) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 24px;
    }

    table {
        min-width: 600px; /* Ensure tables don't squash too much */
    }
    
    /* Stack flex containers with gaps */
    [style*="display: flex"][style*="gap"] {
        flex-wrap: wrap;
    }
    
    /* Make large padding more mobile-friendly */
    [style*="padding: 48px"] {
        padding: 32px !important;
    }
    
    [style*="padding: 40px"] {
        padding: 28px !important;
    }

    /* Fix user avatar sizes in headers */
    .user-profile {
        flex-direction: row !important; /* Keep avatar and name side-by-side if possible */
        align-items: center !important;
    }
}

@media (max-width: 600px) {
    /* Reduce large font sizes */
    [style*="font-size: 2.5rem"],
    [style*="font-size: 2.25rem"],
    .hero-title {
        font-size: 1.75rem !important;
    }
    
    [style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }
    
    [style*="font-size: 1.75rem"] {
        font-size: 1.375rem !important;
    }
    
    [style*="font-size: 1.5rem"] {
        font-size: 1.25rem !important;
    }
    
    [style*="font-size: 1.125rem"] {
        font-size: 1rem !important;
    }
    
    /* Reduce padding further */
    [style*="padding: 48px"],
    [style*="padding: 40px"],
    [style*="padding: 32px"] {
        padding: 20px !important;
    }
    
    [style*="padding: 24px"] {
        padding: 16px !important;
    }
    
    /* Make buttons full width when in flex containers */
    [style*="display: flex"] button,
    .nav__cta {
        flex: 1 1 auto;
        width: 100% !important;
        margin-left: 0 !important;
    }

    /* Handle the dual-button pattern in tables (Present/Absent) */
    [style*="justify-content: flex-end"] {
        justify-content: flex-start !important;
        gap: 8px !important;
    }
}

@media (max-width: 480px) {
    /* Force single column for all grids */
    [style*="display: grid"] {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Stack all flex rows */
    [style*="display: flex"][style*="justify-content: space-between"],
    [style*="display: flex"][style*="justify-content: flex-end"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    /* Full width buttons */
    button,
    .nav__cta,
    .btn {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Reduce large margins */
    [style*="margin-bottom: 48px"],
    [style*="margin-bottom: 40px"] {
        margin-bottom: 24px !important;
    }
    
    [style*="margin-bottom: 32px"] {
        margin-bottom: 20px !important;
    }
    
    [style*="margin-top: 48px"],
    [style*="margin-top: 40px"] {
        margin-top: 24px !important;
    }
    
    [style*="margin-top: 32px"] {
        margin-top: 20px !important;
    }
    
    /* Smaller avatars */
    [style*="width: 100px; height: 100px"] {
        width: 70px !important;
        height: 70px !important;
        font-size: 1.5rem !important;
    }
    
    [style*="width: 80px; height: 80px"] {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.25rem !important;
    }
    
    [style*="width: 56px; height: 56px"] {
        width: 44px !important;
        height: 44px !important;
    }
    
    /* Reduce icon sizes */
    [style*="font-size: 4rem"] {
        font-size: 2.5rem !important;
    }
    
    [style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }
}
