/* ==========================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ========================================================================== */
:root {
    /* Premium Color Palette (Red Brand Theme like CPD) */
    --color-primary: #eb1000;           /* Adobe Red */
    --color-primary-hover: #ff3b30;     /* Lighter Adobe Red */
    --color-primary-light: rgba(235, 16, 0, 0.06); /* Soft red-tinted background */
    --color-surface: #ffffff;           /* Pure white card surface */
    --color-surface-elevated: #F7F9FA;  /* Soft elevated surface like CPD's navy-light */
    --color-bg-main: #ffffff;           /* Solid white main background */
    --color-text-primary: #1c1d1f;      /* Deep charcoal like CPD */
    --color-text-secondary: #6a6f73;    /* Secondary neutral gray like CPD */
    --color-text-muted: #9CA3AF;        /* Muted slate gray */
    --color-text-light: #6a6f73;        /* Secondary/muted */
    --color-border: #d1d7dc;            /* Card border like CPD */
    --color-border-hover: #eb1000;      /* Hover card border */
    --color-accent-success: #10b981;    /* Success emerald */
    --color-accent-warning: #F59E0B;    /* Warning amber */
    --color-accent-danger: #EF4444;     /* Danger red */

    /* Subject Specific Color Tokens (Light CPD theme style) */
    --color-subject-1: #eb1000;         /* Red */
    --color-subject-1-bg: rgba(235, 16, 0, 0.06);
    --color-subject-2: #10B981;         /* Emerald */
    --color-subject-2-bg: rgba(16, 185, 129, 0.08);
    --color-subject-3: #3B82F6;         /* Sky/Blue */
    --color-subject-3-bg: rgba(59, 130, 246, 0.08);
    --color-subject-4: #F59E0B;         /* Amber */
    --color-subject-4-bg: rgba(245, 158, 11, 0.08);
    --color-subject-5: #ec4899;         /* Pink */
    --color-subject-5-bg: rgba(236, 72, 153, 0.08);
    --color-subject-6: #ca8a04;         /* Gold/Dark Amber */
    --color-subject-6-bg: rgba(202, 138, 4, 0.08);
    --color-subject-default: #6a6f73;   /* Slate/Gray */
    --color-subject-default-bg: #F0F2F4;

    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Shadows & Borders (Softer and subtle under light theme) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-premium: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 2px 8px rgba(0, 0, 0, 0.08);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions & Animations */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: #0f172a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: clip;
}

body::before {
    content: '';
    position: fixed;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image: 
        linear-gradient(to bottom, rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0.38)),
        url('student_classroom_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(14px) brightness(0.92);
    -webkit-filter: blur(14px) brightness(0.92);
    transform: scale(1.05);
    z-index: -2;
    pointer-events: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.25;
}

h1 { font-size: 1.75rem; } /* 28px */
h2 { font-size: 1.375rem; } /* 22px */
h3 { font-size: 1.125rem; } /* 18px */

p {
    font-weight: 400;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* Visually Hidden Class for Accessbility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Indicators */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
}

[tabindex="-1"]:focus {
    outline: none !important;
}

/* ==========================================================================
   LAYOUT CONTAINERS & HEADER
   ========================================================================== */
.app-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
    height: auto;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-text-primary);
}

.logo-icon-box {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #eb1000, #b30b00);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.logo-text-solid {
    font-weight: 700;
    color: var(--color-text-primary);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
}

.breadcrumbs {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: var(--color-text-light);
    font-size: 1.125rem;
}

.breadcrumbs a {
    color: var(--color-text-secondary);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.breadcrumbs a:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.breadcrumbs .current {
    color: var(--color-text-muted);
    font-weight: 400;
    padding: 0.25rem 0.5rem;
}

/* Main Content Area */
.app-main {
    flex: 1;
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem 1.5rem;
}

.app-footer {
    background-color: transparent;
    border-top: 1px solid var(--color-border);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.footer-container {
    max-width: 1140px;
    margin: 0 auto;
}

/* ==========================================================================
   BUTTONS & COMMON COMPONENTS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-surface);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-surface-elevated);
    border-color: var(--color-border-hover);
    color: var(--color-text-primary);
}

/* ==========================================================================
   ANIMATIONS & TRANSITIONS
   ========================================================================== */
.step-section {
    display: block;
}

.step-section.hidden {
    display: none;
}

/* Animate step transition (200ms opacity + translateY(8px -> 0)) */
.step-section:not(.hidden) {
    animation: stepFadeIn 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Pulse Animation for Skeletons */
.animate-pulse {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .4;
    }
}

/* ==========================================================================
   LOADER & SKELETON SCREEN
   ========================================================================== */
.loader-view {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 0;
}

.loader-view.hidden {
    display: none;
}

.skeleton-header {
    height: 120px;
    background-color: var(--color-border);
    border-radius: var(--radius-lg);
    width: 100%;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.skeleton-card {
    height: 240px;
    background-color: var(--color-border);
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   ERROR & EMPTY STATE
   ========================================================================== */
.error-view, .empty-view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
}

.error-view.hidden, .empty-view.hidden {
    display: none;
}

.error-card, .empty-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.error-icon, .empty-icon {
    font-size: 3.5rem;
    line-height: 1;
}

.error-card h2, .empty-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
}

.error-card p, .empty-card p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

/* ==========================================================================
   STEP 1: GRADE SELECTION SCREEN
   ========================================================================== */
.hero-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.top-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(235, 16, 0, 0.06);
    border: 1px solid rgba(235, 16, 0, 0.15);
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
    box-shadow: none;
}

.badge-icon {
    font-size: 0.875rem;
}

.badge-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--color-text-primary);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 600px;
}

/* Upload Zone */
.upload-zone {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 500px;
    border: 2px dashed var(--color-border);
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--color-primary);
    background-color: rgba(235, 16, 0, 0.02);
    transform: scale(1.01);
}

.upload-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 2rem;
}

.upload-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.upload-label {
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
}

.upload-label:hover {
    text-decoration: underline;
}

.upload-help {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Grades Grid */
.grades-container {
    border-top: 1px solid var(--color-border);
    padding-top: 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    justify-content: center;
}

/* Search Container for Grades filtering */
.search-container {
    max-width: 450px;
    width: 100%;
    margin: 0 auto 2rem auto;
    display: flex;
    justify-content: center;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1.25rem;
    font-size: 1.1rem;
    color: var(--color-text-muted);
    pointer-events: none;
    user-select: none;
}

.search-input-wrapper input[type="text"] {
    width: 100%;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-primary);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.search-input-wrapper input[type="text"]::placeholder {
    color: var(--color-text-muted);
}

.search-input-wrapper input[type="text"]:hover {
    border-color: var(--color-border-hover);
}

.search-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-light), var(--shadow-md);
}

/* Clear button styling */
.clear-search-btn {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    transition: var(--transition-fast);
}

.clear-search-btn:hover {
    background-color: rgba(235, 16, 0, 0.1);
    color: var(--color-primary);
}

.clear-search-btn.hidden {
    display: none;
}

/* No results state */
.no-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.no-results p {
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Grade Card (CPD Theme style) */
.grade-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.grade-card:hover {
    background-color: var(--color-surface-elevated);
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.grade-card.active {
    border-color: var(--color-primary);
    background-color: var(--color-surface-elevated);
    box-shadow: 0 8px 24px rgba(235, 16, 0, 0.12);
    transform: translateY(-2px);
}

.grade-card.active.card-accent-pink {
    border-top-color: var(--color-subject-5);
}
.grade-card.active.card-accent-green {
    border-top-color: var(--color-subject-2);
}
.grade-card.active.card-accent-indigo {
    border-top-color: var(--color-subject-1);
}

.grade-card.active .grade-card-footer {
    color: var(--color-primary);
    border-top-color: rgba(235, 16, 0, 0.15);
}

.grade-card:focus-visible {
    border-color: var(--color-primary);
    transform: translateY(-4px);
}

/* Accent Borders */
.card-accent-pink {
    border-top: 3px solid var(--color-subject-5);
}
.card-accent-green {
    border-top: 3px solid var(--color-subject-2);
}
.card-accent-indigo {
    border-top: 3px solid var(--color-subject-1);
}

/* Grade Icon Container */
.grade-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.icon-bg-pink {
    background-color: var(--color-subject-5-bg);
    color: var(--color-subject-5);
}
.icon-bg-green {
    background-color: var(--color-subject-2-bg);
    color: var(--color-subject-2);
}
.icon-bg-indigo {
    background-color: var(--color-subject-1-bg);
    color: var(--color-subject-1);
}

.grade-icon-emoji {
    font-size: 1.75rem;
    line-height: 1;
}

.grade-card-title {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.25rem;
}

.grade-card-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.grade-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: var(--transition-normal);
}

.grade-card:hover .grade-card-footer {
    color: var(--color-primary);
    border-top-color: rgba(235, 16, 0, 0.15);
}

.explore-grade-text {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grade-card-footer .arrow-icon {
    font-size: 1rem;
    transition: transform var(--transition-fast);
}

.grade-card:hover .arrow-icon {
    transform: translateX(4px);
}

/* ==========================================================================
   STEP 2: ACTIVITY SELECTION SCREEN
   ========================================================================== */
.step-header {
    text-align: left;
    margin-bottom: 2rem;
}

.step-header .section-title {
    text-align: left;
    margin-bottom: 0.25rem;
}

.section-subtitle {
    color: var(--color-text-secondary);
    font-size: 1rem;
}

/* Filter Bar */
.filter-bar {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Select Styling */
.select-wrapper {
    position: relative;
    width: 200px;
}

.filter-select {
    width: 100%;
    appearance: none;
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.625rem 2.25rem 0.625rem 1rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-select:hover {
    border-color: var(--color-border-hover);
    background-color: var(--color-surface);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.select-wrapper::after {
    content: "";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--color-text-secondary);
    border-bottom: 2px solid var(--color-text-secondary);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

/* Difficulty Buttons Group */
.difficulty-toggles {
    display: inline-flex;
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    gap: 0.25rem;
}

.toggle-btn {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 0.375rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toggle-btn:hover {
    color: var(--color-text-primary);
    background-color: var(--color-border);
}

.toggle-btn.active {
    background-color: var(--color-primary);
    color: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

/* Activities Grid */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* Activity Card */
.activity-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-height: 170px;
}

.activity-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-hover);
}

.activity-card:focus-visible {
    transform: translateY(-4px);
    border-color: var(--color-primary);
}

.activity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

/* Subject Tag Colored Pills */
.subject-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

/* Deterministic Subject Colors classes mapping */
.subject-color-1 { color: var(--color-subject-1); background-color: var(--color-subject-1-bg); border-color: rgba(235, 16, 0, 0.15); }
.subject-color-2 { color: var(--color-subject-2); background-color: var(--color-subject-2-bg); border-color: rgba(16, 185, 129, 0.15); }
.subject-color-3 { color: var(--color-subject-3); background-color: var(--color-subject-3-bg); border-color: rgba(59, 130, 246, 0.15); }
.subject-color-4 { color: var(--color-subject-4); background-color: var(--color-subject-4-bg); border-color: rgba(245, 158, 11, 0.15); }
.subject-color-5 { color: var(--color-subject-5); background-color: var(--color-subject-5-bg); border-color: rgba(236, 72, 153, 0.15); }
.subject-color-6 { color: var(--color-subject-6); background-color: var(--color-subject-6-bg); border-color: rgba(202, 138, 4, 0.15); }
.subject-color-default { color: var(--color-subject-default); background-color: var(--color-subject-default-bg); border-color: var(--color-border); }

/* Activity Card Top Border Accent Styles */
.card-accent-subject-color-1 { border-top: 3px solid var(--color-subject-1); }
.card-accent-subject-color-2 { border-top: 3px solid var(--color-subject-2); }
.card-accent-subject-color-3 { border-top: 3px solid var(--color-subject-3); }
.card-accent-subject-color-4 { border-top: 3px solid var(--color-subject-4); }
.card-accent-subject-color-5 { border-top: 3px solid var(--color-subject-5); }
.card-accent-subject-color-6 { border-top: 3px solid var(--color-subject-6); }
.card-accent-subject-color-default { border-top: 3px solid var(--color-subject-default); }

/* Duration badge */
.duration-badge {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.activity-name {
    font-size: 1.0625rem; /* 17px */
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
    /* Limit title line height and wrap */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em; /* height fit for 2 lines */
    margin-bottom: auto;
}

/* Custom footer for activity cards */
.activity-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto; /* Push to bottom of card */
    padding-top: 0.875rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: var(--transition-normal);
}

.activity-card:hover .activity-card-footer {
    color: var(--color-primary);
    border-top-color: rgba(235, 16, 0, 0.15);
}

.activity-card-footer .arrow-icon {
    font-size: 1rem;
    transition: transform var(--transition-fast);
}

.activity-card:hover .arrow-icon {
    transform: translateX(4px);
}

.view-activity-text {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Difficulty Indicator: 3-dot scale */
.difficulty-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-top: auto; /* Push to bottom of card */
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
}

.difficulty-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.difficulty-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-border);
}

.difficulty-dot.filled {
    background-color: var(--color-accent-warning);
}

/* ==========================================================================
   STEP 3: ACTIVITY DETAIL SCREEN
   ========================================================================== */
.detail-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.back-link-wrapper {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.back-link:hover {
    color: var(--color-primary);
}

.back-link:hover .arrow {
    transform: translateX(-4px);
}

.back-link .arrow {
    transition: transform var(--transition-fast);
}

/* Detail Panel (Glassmorphic & Premium) */
.detail-panel {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.detail-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-main-title {
    font-size: 1.75rem; /* 28px */
    font-weight: 600;
    color: var(--color-text-primary);
}

.detail-quick-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.meta-label {
    font-weight: 600;
    color: var(--color-text-secondary);
}

.meta-val {
    color: var(--color-text-primary);
}

/* Large difficulty dots styling */
.difficulty-dots-large {
    display: inline-flex;
    gap: 0.375rem;
}

.difficulty-dots-large .difficulty-dot {
    width: 10px;
    height: 10px;
}

/* Detail Body Section */
.detail-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-section-title {
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    color: var(--color-text-primary);
    border-left: 3px solid var(--color-primary);
    padding-left: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-description-container {
    background: linear-gradient(135deg, var(--color-surface) 0%, rgba(235, 16, 0, 0.01) 100%);
    border: 1px solid rgba(235, 16, 0, 0.08);
    border-left: 5px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.75rem;
    margin-top: 0.5rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
    white-space: pre-wrap;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.detail-description-container:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(235, 16, 0, 0.15);
    transform: translateY(-1px);
}

/* Metadata Grid */
.detail-metadata {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.metadata-entry {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metadata-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.metadata-value {
    font-size: 0.9375rem;
    color: var(--color-text-primary);
    word-break: break-word;
}

/* CTA Footer section with dual button layout */
.detail-cta-section {
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
    margin-top: 1rem;
}

.cta-buttons-container {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons-container .btn {
    flex: 1;
    max-width: 300px;
    font-size: 0.9375rem;
    padding: 0.875rem 1.5rem;
}

.no-tutorial-notice {
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    flex: 1;
    max-width: 300px;
}

/* Skills and Instructions Typography */
.detail-skills-instructions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.detail-skills-text {
    font-size: 0.9375rem;
    color: var(--color-text-primary);
    line-height: 1.6;
}

.detail-instructions-text {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

/* Student Work Submission Panel */
.detail-submission-section {
    background-color: rgba(235, 16, 0, 0.04);
    border: 1px solid rgba(235, 16, 0, 0.12);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submission-prompt {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.submission-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.submission-subtext {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-input {
    font-family: var(--font-body);
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-input.input-error {
    border-color: #ef4444 !important;
}

.form-input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.form-actions .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.submission-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 1rem 0;
}

.success-icon {
    font-size: 2.5rem;
}

.success-text-wrapper h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text-primary);
}

.success-text-wrapper p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}




/* Modal overlay and popup container styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 29, 31, 0.75); /* Clean dark overlay matching CPD */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-premium);
    position: relative;
    animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--color-text-primary);
}


/* Welcome Landing Choice Screen */
.welcome-container {
    max-width: 800px;
    margin: 2rem auto 4rem auto;
    width: 100%;
}

.welcome-choices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.welcome-choice-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 3.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.welcome-choice-card:hover {
    background-color: var(--color-surface-elevated);
    border-color: var(--color-primary);
    transform: translateY(-6px);
    box-shadow: 0 12px 24px -8px rgba(235, 16, 0, 0.15);
}

.welcome-choice-card.card-accent-pink:hover {
    border-color: var(--color-primary);
    box-shadow: 0 12px 24px -8px rgba(235, 16, 0, 0.15);
}

.welcome-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-accent-indigo .welcome-icon-wrapper {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.card-accent-pink .welcome-icon-wrapper {
    background-color: rgba(235, 16, 0, 0.04);
    color: var(--color-primary);
}

.welcome-choice-card:hover .welcome-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.welcome-choice-card h3 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    color: var(--color-text-primary);
    transition: var(--transition-fast);
}

.welcome-choice-card:hover h3 {
    color: var(--color-primary);
}

.welcome-choice-card.card-accent-pink:hover h3 {
    color: var(--color-primary);
}

.welcome-choice-card p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    flex: 1;
}

.welcome-choice-card .btn {
    width: 100%;
    max-width: 200px;
    transition: all 0.3s ease;
}

.welcome-choice-card:hover .btn {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(235, 16, 0, 0.2);
}

.welcome-choice-card.card-accent-pink:hover .btn {
    box-shadow: 0 4px 12px rgba(235, 16, 0, 0.2);
}


/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Tablet & Smaller Screens */
@media (max-width: 768px) {
    body {
        font-size: 0.9375rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .select-wrapper {
        width: 100%;
    }

    .difficulty-toggles {
        width: 100%;
        display: flex;
    }

    .toggle-btn {
        flex: 1;
        text-align: center;
        padding: 0.5rem 0.25rem;
    }

    .detail-panel {
        padding: 1.5rem;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        min-height: 56px;
    }
    
    .breadcrumb-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.2rem;
    }

    .breadcrumb-nav::-webkit-scrollbar {
        display: none;
    }
    
    .breadcrumbs {
        flex-wrap: nowrap;
        white-space: nowrap;
        font-size: 0.825rem;
        gap: 0.25rem;
    }

    .breadcrumbs .current {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
    }
}

/* Mobile Screens */
@media (max-width: 600px) {
    .welcome-header-wrapper {
        padding: 1.25rem 1rem 0.75rem !important;
    }
    .hero-title {
        font-size: 1.65rem !important;
    }
    .hero-subtitle {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 1.5rem 1rem 3rem 1rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .upload-zone {
        padding: 1rem;
    }

    .upload-content {
        flex-direction: column;
        text-align: center;
    }

    .upload-text-wrapper {
        align-items: center;
        text-align: center;
    }

    .grades-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.75rem;
    }

    .grade-card {
        padding: 1rem 0.75rem;
    }

    .grade-card-label {
        font-size: 1.25rem;
    }

    .detail-description-container {
        padding: 1.25rem 1rem;
    }
}

/* General visibility utility */
.hidden {
    display: none !important;
}

/* Premium Floating Tooltip */
.activity-tooltip {
    position: absolute;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(235, 16, 0, 0.12);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 25px -5px rgba(235, 16, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    max-width: 360px;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
}

.activity-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.activity-tooltip .tooltip-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0;
    line-height: 1.3;
}

/* ==========================================================================
   PRO MAX GLASSMORPHISM DESIGN SYSTEM (ULTRA GLASSY & HIGH-CONTRAST FONTS)
   ========================================================================== */
.app-header {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
}

/* Page Titles, Section Titles & Hero text against blurred classroom bg */
.hero-title, 
.hero-subtitle, 
.page-title, 
.section-heading, 
.section-subtitle, 
.step-title, 
.step-subtitle, 
.hero-section h1, 
.hero-section p,
.section-title,
#activities-title,
#activities-subtitle,
.step-header .section-title {
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.95) !important;
}

.hero-title, 
.page-title, 
.section-heading, 
.step-title, 
.hero-section h1,
.section-title,
#activities-title,
.step-header .section-title {
    color: #ffffff !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
}

.hero-subtitle, 
.section-subtitle, 
.step-subtitle, 
.hero-section p,
#activities-subtitle {
    color: #f8fafc !important;
    font-weight: 500 !important;
}

/* Ultra Glassy Containers Across All Screens */
.grade-card, 
.activity-card, 
.detail-panel, 
.welcome-choice-card, 
.filter-section, 
.modal-content,
.instruction-box,
.skills-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.62)) !important;
    backdrop-filter: blur(32px) saturate(210%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(210%) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255, 255, 255, 1) inset !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, background 0.25s ease !important;
}

.grade-card:hover, 
.activity-card:hover, 
.welcome-choice-card:hover {
    transform: translateY(-5px) scale(1.015) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8)) !important;
    border-color: rgba(235, 16, 0, 0.65) !important;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.26), 0 0 28px rgba(235, 16, 0, 0.22) !important;
}

/* Highlighted Text inside cards */
.grade-card-title, .activity-card-title, .detail-main-title, .welcome-choice-card h3 {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.grade-card-subtitle, .activity-card-description, .meta-label {
    color: #334155 !important;
    font-weight: 600 !important;
}

/* Glass search & dropdown inputs */
.search-wrapper, .filter-select {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.72)) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.95) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
}

.search-input {
    background: transparent !important;
    color: #0f172a !important;
    font-weight: 600 !important;
}

.search-input::placeholder {
    color: #475569 !important;
}

/* Back Link Pills */
.back-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: rgba(15, 23, 42, 0.68) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    color: #ffffff !important;
    padding: 0.5rem 1.15rem !important;
    border-radius: 9999px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28) !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.back-link:hover {
    background: rgba(235, 16, 0, 0.92) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
}

/* Modals */
.modal-overlay {
    background-color: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

/* Language Toggle Switch (Positioned on Extreme Right) */
.welcome-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.25rem 0.45rem;
    border-radius: 9999px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    z-index: 50;
    flex-shrink: 0;
    margin-left: auto;
}

.lang-toggle-btn {
    padding: 0.25rem 0.75rem !important;
    border-radius: 9999px !important;
    border: none !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
    color: #475569 !important;
}
.lang-toggle-btn:hover {
    color: #0f172a !important;
}
.lang-toggle-btn.active-lang {
    background: #eb1000 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(235, 16, 0, 0.4) !important;
}

@media (max-width: 480px) {
    .logo-text-solid {
        display: none !important;
    }
    .welcome-lang-toggle {
        padding: 0.2rem 0.35rem !important;
    }
    .lang-toggle-btn {
        padding: 0.2rem 0.55rem !important;
        font-size: 0.75rem !important;
    }
    .go-to-activity-heading {
        font-size: 1.45rem !important;
    }
}

/* Disable floating tooltips on touch devices to prevent tap overlap */
@media (hover: none) {
    .activity-tooltip {
        display: none !important;
        pointer-events: none !important;
    }
}

/* Quick Activity Search & Responsive Layout Adjustments */
.quick-result-item:hover {
    border-color: var(--color-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 16, 0, 0.12) !important;
}

/* Tablet & Mobile Responsiveness (<= 992px & <= 768px) */
@media (max-width: 992px) {
    .welcome-header-wrapper {
        flex-direction: column !important;
        align-items: stretch !important;
        min-height: auto !important;
        gap: 1.25rem !important;
    }
    .welcome-header-wrapper > div:first-child {
        text-align: center !important;
    }
    .welcome-header-wrapper .hero-title,
    .welcome-header-wrapper .hero-subtitle {
        text-align: center !important;
    }
    .important-note-card {
        max-width: 100% !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .quick-search-wrapper {
        flex-direction: column !important;
        padding: 1.25rem !important;
        gap: 1.25rem !important;
    }
    .quick-search-wrapper > div:first-child {
        border-right: none !important;
        border-bottom: 1px solid var(--color-border) !important;
        padding-right: 0 !important;
        padding-bottom: 1rem !important;
    }
    .quick-search-wrapper > div:last-child {
        max-height: 260px !important;
    }
    .filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .filter-cert-notice {
        width: 100% !important;
    }
    .welcome-choice-card {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .important-note-card {
        padding: 0.75rem 0.9rem !important;
    }
}

/* ==========================================================================
   KAUSHAL BODH STYLING & COMPONENTS
   ========================================================================== */
.kb-form-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 700;
    line-height: 1;
}

.form-life-forms {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.form-machines-materials {
    background-color: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.form-human-services {
    background-color: rgba(139, 92, 246, 0.12);
    color: #6d28d9;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.form-general {
    background-color: rgba(107, 114, 128, 0.12);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.25);
}

.kb-section-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.kb-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-primary);
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

.kb-journal-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.kb-journal-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45) !important;
}

.kb-template-btn {
    transition: all 0.2s ease !important;
}

.kb-template-btn:hover {
    background: rgba(235, 16, 0, 0.06) !important;
    transform: translateY(-2px) !important;
}

.kb-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    gap: 0.5rem;
}

.kb-journal-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #2563eb;
    color: white !important;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.kb-journal-card-link:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

/* ==========================================================================
   KAUSHAL BODH — SECTION LAYOUT & FORM OF WORK RECTANGULAR CARDS
   ========================================================================== */
.kaushal-tabs-container {
    width: 100%;
    margin-bottom: 0;
}

/* --- Section Box (visible container for Form of Work) --- */
.kb-section-box {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.5rem 1.25rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* --- Projects sub-section header --- */
.kb-projects-header {
    margin-bottom: 1.25rem;
}

.kb-section-header {
    margin-bottom: 1.25rem;
}

.kb-section-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #eb1000;
    background: rgba(235, 16, 0, 0.08);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
}

.kb-section-heading {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0.35rem 0 0.2rem 0;
}

.kb-section-subtext {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* --- Rectangular Form of Work Cards Row --- */
.kb-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
}

.kb-form-rect-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.kb-form-rect-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--kb-theme-border, var(--color-border-hover));
}

.kb-form-rect-card.kb-rect-active {
    background: var(--kb-theme-bg);
    border-color: var(--kb-theme);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--kb-theme) 20%, transparent);
}

/* Icon */
.kb-rect-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--kb-theme-icon-bg, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.kb-rect-active .kb-rect-icon {
    background: var(--kb-theme);
    filter: saturate(1.2);
}

/* Body */
.kb-rect-body {
    flex: 1;
    min-width: 0;
}

.kb-rect-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 0.1rem 0;
    line-height: 1.3;
}

.kb-rect-active .kb-rect-title {
    color: var(--kb-theme);
}

.kb-rect-subtitle {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Meta (right side) */
.kb-rect-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.kb-rect-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: #f1f5f9;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
}

.kb-rect-active .kb-rect-count {
    background: var(--kb-theme-icon-bg);
    color: var(--kb-theme);
}

.kb-rect-status {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-tertiary);
    transition: all 0.2s ease;
}

.kb-rect-active .kb-rect-status {
    color: var(--kb-theme);
    font-size: 1.2rem;
}

/* Comprehensive Responsive adjustments for Mobile & Tablet */
@media (max-width: 992px) {
    .fow-grid, #fow-grid, .grade-grid, #grade-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
        gap: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    .fow-grid, #fow-grid, .grade-grid, #grade-grid,
    .activities-grid, #fow-activities-grid, #activities-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .detail-container {
        padding: 0 0.5rem !important;
        max-width: 100% !important;
    }

    .detail-panel {
        padding: 1.35rem 1rem !important;
        border-radius: var(--radius-lg) !important;
    }

    .detail-main-title {
        font-size: 1.45rem !important;
    }

    .step-section {
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
    }
}

@media (max-width: 480px) {
    .kb-form-rect-card {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .kb-rect-meta {
        width: 100%;
        justify-content: flex-end;
        padding-top: 0.5rem;
        border-top: 1px solid var(--color-border);
    }
    .detail-panel {
        padding: 1.15rem 0.85rem !important;
    }
    .detail-main-title {
        font-size: 1.3rem !important;
    }
    .kb-journal-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ==========================================================================
   DCAIS Page Instruction Popup Callouts (Blinking Beacon & Popover)
   ========================================================================== */
.blinking-dot {
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
    animation: blink-pulse 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes blink-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
    }
    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.dcais-instruction-popover-wrapper {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    width: auto;
    margin: 0;
    pointer-events: none;
}

.dcais-instruction-popover,
.dcais-popover-trigger-badge {
    pointer-events: auto;
}

.dcais-instruction-popover {
    position: relative;
    max-width: 480px;
    width: calc(100vw - 48px);
    margin: 0;
    z-index: 10000;
    animation: popover-slide-up 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popover-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dcais-instruction-popover-content {
    position: relative;
    background: #ffffff !important;
    border: 2.5px solid #1e293b;
    border-radius: 18px;
    padding: 0.85rem 1.15rem 0.85rem 0.85rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    overflow: hidden;
}

.popover-mascot-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 105px;
    position: relative;
}

.popover-mascot-img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.18));
    transition: transform 0.3s ease;
    transform: scale(1.32);
}

.popover-mascot-img:hover {
    transform: scale(1.38) rotate(3deg);
}

.popover-message-right {
    flex: 1;
    padding-right: 0.75rem;
}

/* Speech Bubble Tail pointing down at bottom corner */
.dcais-instruction-popover-content::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: 28px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid #1e293b;
}

.dcais-instruction-popover-content::before {
    content: '';
    position: absolute;
    bottom: -11px;
    right: 29px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 13px solid #ffffff;
    z-index: 2;
}

.dcais-popover-close-btn {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: #475569 !important;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 5;
}

.dcais-popover-close-btn:hover {
    color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.1);
}

.dcais-popover-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.dcais-popover-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f1f5f9;
    padding: 0.2rem 0.6rem;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
}

.popover-badge-title {
    font-weight: 800;
    font-size: 0.75rem;
    color: #0f172a !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dcais-popover-body-text {
    margin: 0;
    font-size: 0.885rem !important;
    color: #0f172a !important;
    line-height: 1.45;
    font-weight: 600 !important;
    text-shadow: none !important;
    font-family: var(--font-body);
}

.dcais-popover-trigger-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 2.5px solid #1e293b;
    padding: 0.4rem 0.9rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    margin: 0.5rem 0;
}

.dcais-popover-trigger-badge:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.mascot-character-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 380px;
    padding-right: 18px;
    margin-top: 4px;
}

.aim-mascot-img {
    width: 105px;
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aim-mascot-img:hover {
    transform: scale(1.08) rotate(3deg);
}


