/* tutorials.css - OPTIMIZED for Tutorials page with modified desktop tiles */

/* Root variables for tutorials page */
:root {
    --primary: #007849; /* Zambian Green */
    --secondary: #EF3340; /* Zambian Red */
    --accent: #FFD100; /* Zambian Yellow/Gold */
    --light: #f8f9fa;
    --dark: #1D1D1B; /* Dark charcoal for text */
    --gray: #6c757d;
    --dull-white: #f5f5f5;
    --zambian-orange: #E05206; /* Zambian Orange from flag */
    --zambian-black: #000000; /* Zambian Black */
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Critical layout styles to prevent FOUC */
.tutorials-header {
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    touch-action: pan-y;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.tutorials-header.scrolled {
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.tutorials-logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tutorials-logo {
    width: 38px;
    height: 38px;
    background: transparent;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-shrink: 0;
}

.tutorials-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tutorials-logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Content wrapper for fade-in effect */
.content-wrapper {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.content-wrapper.loaded {
    opacity: 1;
}

/* Loading screen styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: white;
    font-size: 1rem;
    opacity: 0.8;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Base body styles */
body {
    font-family: 'Segoe UI', 'Poppins', sans-serif;
    color: white;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)),
        url('https://images.unsplash.com/photo-1523240795612-9a054b0db644?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') fixed center/cover no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Styles */
.tutorials-nav-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tutorials-nav-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    width: 100%;
    box-shadow: var(--shadow-medium);
    border-radius: 0 0 10px 10px;
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 999;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.tutorials-nav-menu.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.tutorials-nav-item {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: all var(--transition-normal);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid transparent;
}

.tutorials-nav-item:hover {
    background: rgba(0, 120, 73, 0.1);
    color: var(--primary);
    border-color: rgba(0, 120, 73, 0.2);
}

.tutorials-nav-item.tutorials-active {
    background: rgba(0, 120, 73, 0.05);
    color: var(--primary);
    font-weight: 600;
    border-color: rgba(0, 120, 73, 0.1);
}

.tutorials-nav-item.tutorials-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.tutorials-nav-item.tutorials-active i {
    color: var(--secondary);
}

.tutorials-nav-item i {
    color: var(--primary);
    width: 20px;
    text-align: center;
    transition: color var(--transition-normal);
    flex-shrink: 0;
}

.tutorials-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    -webkit-tap-highlight-color: transparent;
    z-index: 1001;
}

.tutorials-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    transition: all var(--transition-normal);
    transform-origin: center;
}

.tutorials-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.tutorials-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.tutorials-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Banner Styles */
.banner-container {
    width: 100%;
    min-height: auto;
    box-shadow: var(--shadow-medium);
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url('/img/image.gif') center/cover no-repeat;
    will-change: transform;
}

.nav-section {
    position: relative;
    width: 100%;
    height: 16vh;
    min-height: 120px;
    max-height: 160px;
    overflow: hidden;
    flex-shrink: 0;
}

.banner-image-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.banner-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200'%3E%3Cpath d='M0,0 L1000,0 L1000,140 C900,150 800,156 700,160 C600,164 500,166 400,160 C300,154 200,140 100,130 C0,120 0,140 0,140 Z' fill='#FFFFE0'/%3E%3C/svg%3E");
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    mask-position: bottom;
    z-index: 2;
    pointer-events: none;
}

.main-content-area {
    flex: 1;
    padding: 8px 15px 20px 15px;
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
}

.welcome-section {
    text-align: center;
    margin-bottom: 15px;
    color: #2d3748;
    padding-top: 1.5rem;
}

.welcome-section h1 {
    font-size: clamp(1.5rem, 5vw, 2.8rem);
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: white;
    margin-top: 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.welcome-section p {
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    color: white;
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.subject-list-container {
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: 780px;
    margin: 0 auto;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    border-bottom: 0.1px solid rgba(255, 255, 224, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

.category-item:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3));
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid var(--accent);
    margin: 0;
    user-select: none;
}

.category-header:hover {
    background-color: rgba(154, 205, 50, 0.5);
}

.category-header:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.category-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #FFFFE0;
    flex: 1;
    line-height: 1.3;
}

.toggle-icon {
    color: #FFFFE0;
    font-size: 0.9rem;
    transition: transform var(--transition-normal);
    margin-left: 10px;
    flex-shrink: 0;
}

.toggle-icon.rotated {
    transform: rotate(90deg);
}

.subjects-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4));
}

.subjects-sublist.expanded {
    max-height: 500px;
    overflow-y: auto;
}

.subject-link-item {
    display: block;
    padding: 10px 16px 10px 24px;
    border-top: 0.3px solid rgba(255, 255, 224, 0.5);
    background: rgba(220, 255, 220, 0.6);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

.subject-link-item:hover {
    background: rgba(255, 255, 220, 0.8);
    padding-left: 28px;
}

.subject-link-item:hover .subject-name {
    color: black;
    font-weight: 600;
}

.subject-name {
    font-size: 1rem;
    font-weight: 400;
    color: black;
    line-height: 1.3;
}

.link-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.subject-link-item:hover .link-arrow {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
}

/* Category-specific styles */
.category-item.natural .category-header {
    border-left-color: #fff5ee;
}

.category-item.social .category-header {
    border-left-color: #fff5ee;
}

.category-item.computer .category-header {
    border-left-color: #fff5ee;
}

.category-item.mathematics .category-header {
    border-left-color: #fff5ee;
}

.category-item.business .category-header {
    border-left-color: #fff5ee;
}

.category-item.language .category-header {
    border-left-color: #fff5ee;
}

/* Auto-scroll Nav */
.banner-footer-nav {
    width: 100%;
    height: 38px;
    background: #fff5ee;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border-bottom: 0.3px solid rgba(255, 255, 224, 0.5);
    border-top: 0.3px solid rgba(255, 255, 224, 0.5);
    margin-top: auto;
}

.links-container {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.subject-links {
    display: flex;
    gap: 15px;
    list-style: none;
    padding: 0 20px;
    animation: scrollLinks 40s linear infinite;
    height: 100%;
    align-items: center;
    white-space: nowrap;
}

.subject-links:hover {
    animation-play-state: paused;
}

.subject-link {
    color: #00072D;
    text-decoration: none;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.subject-link:hover {
    background: var(--accent);
    color: black;
    transform: translateY(-1px);
}

.subject-link i {
    font-size: 0.8rem;
}

@keyframes scrollLinks {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Course Grid Styles - SHOW ON MOBILE ONLY */
.course-catalog {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-top:  1px;
    background: transparent;
    display: block;
}

.grid-container {
    display: grid;
    grid-gap: 1px;
    grid-template-columns: repeat(2, 1fr);
    background-color: rgba(220, 220, 220, 0.3);
    width: 100%;
    margin: 0;
    padding: 2px 2px;
}

.course-tile {
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    height: 100%;
    min-height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.course-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
    box-sizing: border-box;
}

.course-tile:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.course-content {
    padding: 20px 16px;
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.course-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    line-height: 1.25;
    letter-spacing: 0.2px;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.course-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.course-link {
    display: inline-flex;
    align-items: center;
    color: #4fc3f7;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    transition: all var(--transition-fast);
}

.course-link i {
    margin-left: 8px;
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.course-tile:hover .course-link {
    color: #80d8ff;
}

.course-tile:hover .course-link i {
    transform: translateX(4px);
}

/* Background Images - Optimized loading */
.course-tile.loaded {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.tile-1 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1635070041078-e363dbe005cb?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-2 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1509228468518-180dd4864904?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-3 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1532094349884-543bc11b234d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-4 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1532187863486-abf9dbad1b69?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-5 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1530021232320-687d8e3dba5e?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-6 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1521295121783-8a321d551ad2?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-7 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1532012197267-da84d127e765?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-8 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1518709268805-4e9042af2176?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-9 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1517077304055-6e89abbf09b0?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-10 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-11 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1604594849809-dfedbc827105?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }
.tile-12 { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1516979187457-637abb4f9353?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80'); }

/* MODIFIED DESKTOP SUBJECTS VIEW - FIXED SPACING, FULL WIDTH, NO ANIMATIONS */
.desktop-subjects-view {
    background-color: #fff5ee;
    display: none;
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem 1rem; /* Reduced spacing by 50% */
    width: 100%;
}

.desktop-subjects-view h2 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-weight: 700;
    margin-top: 0.5rem; /* Reduced top margin */
}

.desktop-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); /* Increased min-width for larger tiles */
    gap: 1rem;
    margin-top: 0;
    width: 100%;
}

.desktop-subject-card {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    min-height: 260px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: block;
    text-decoration: none;
    color: white;
    border: none;
    width: 100%;
    height: 100%;
    /* Removed all transform animations */
    transition: box-shadow 0.3s ease;
}

.desktop-subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.7));
    z-index: 1;
}

.desktop-subject-card:hover {
    /* Removed translateY transform */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.subject-card-content {
    position: relative;
    z-index: 2;
    padding: 1.8rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.subject-card-header {
    margin-bottom: 1rem;
}

.subject-card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.subject-card-category {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.subject-card-description {
    margin-bottom: 1.5rem;
}

.subject-card-description p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.subject-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.subject-lessons {
    font-size: 0.85rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subject-lessons i {
    color: var(--accent);
}

.desktop-tile-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    background: rgba(0, 120, 73, 0.7);
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.desktop-subject-card:hover .desktop-tile-cta {
    background: var(--primary);
    /* Removed transform animation */
    box-shadow: 0 5px 15px rgba(0, 120, 73, 0.4);
}

.desktop-tile-cta i {
    font-size: 0.8rem;
}

/* Contextual Background Images for Desktop Tiles */
.desktop-tile-math1 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1635070041078-e363dbe005cb?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-math2 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1509228468518-180dd4864904?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-physics {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1532094349884-543bc11b234d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-chemistry {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1532187863486-abf9dbad1b69?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-biology {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1530021232320-687d8e3dba5e?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-computer {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1517077304055-6e89abbf09b0?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-ict {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1518709268805-4e9042af2176?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-english {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1516979187457-637abb4f9353?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-accounts {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-commerce {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1604594849809-dfedbc827105?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-geography {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1521295121783-8a321d551ad2?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-history {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1532012197267-da84d127e765?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-literature {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1509228468518-180dd4864904?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-re2044 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1604594849809-dfedbc827105?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-re2046 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1518709268805-4e9042af2176?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

.desktop-tile-civic {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1581833971358-2c8b550f87b3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

/* Performance Optimizations */
.tutorials-tile, 
.course-tile,
.category-header,
.subject-link-item {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Footer Styles */
footer {
    background: var(--dark) !important;
    color: white !important;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section {
    margin-bottom: 1.5rem;
}

.footer-title {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.contact-item i {
    color: var(--accent);
    width: 20px;
}

.copyright {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    .tutorials-menu-toggle {
        display: none;
    }
    
    .tutorials-nav-menu {
        display: flex;
        position: static;
        flex-direction: row;
        background: transparent;
        box-shadow: none;
        padding: 0;
        width: auto;
        z-index: auto;
        max-height: none;
        overflow-y: visible;
        transform: none;
        opacity: 1;
    }
    
    .tutorials-nav-item {
        color: var(--primary);
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .tutorials-nav-item.tutorials-active::after {
        bottom: -5px;
    }
    
    /* HIDE MOBILE GRID ON TABLETS AND LARGER SCREENS */
    .course-catalog {
        display: none !important;
    }
    
    /* SHOW DESKTOP SUBJECTS VIEW */
    .desktop-subjects-view {
        display: block !important;
        padding: 1.5rem 2rem; /* Adjusted for desktop */
    }
    
    .desktop-subjects-view h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .desktop-subjects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .nav-section {
        height: 14vh;
        min-height: 100px;
        max-height: 140px;
    }
    
    .main-content-area {
        padding: 6px 12px 15px 12px;
    }
    
    .welcome-section {
        margin-bottom: 12px;
        padding-top: 1rem;
    }
    
    .banner-footer-nav {
        height: 36px;
    }
    
    .category-header {
        padding: 12px 16px;
    }
    
    .category-title {
        font-size: 1.3rem;
    }
    
    .subject-link-item {
        padding: 10px 16px 10px 24px;
    }
    
    .subject-link-item:hover {
        padding-left: 28px;
    }
    
    .subject-links {
        gap: 20px;
        padding: 0 30px;
    }
}

@media (min-width: 1024px) {
    .desktop-subjects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.8rem;
    }
    
    .desktop-subject-card {
        min-height: 280px;
    }
    
    .subject-card-title {
        font-size: 1.7rem;
    }
    
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .course-tile {
        min-height: 180px;
    }
    
    .course-title {
        font-size: 1.2rem;
    }
    
    .course-desc {
        -webkit-line-clamp: 3;
        font-size: 0.9rem;
    }
}

@media (min-width: 1200px) {
    .desktop-subjects-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .desktop-subjects-view {
        padding: 2rem 3rem; /* Reduced from 4rem */
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .desktop-subject-card {
        min-height: 300px;
    }
    
    .subject-card-title {
        font-size: 1.8rem;
    }
    
    .welcome-section h1 {
        font-size: 3rem;
    }
    
    .welcome-section p {
        font-size: 1.4rem;
    }
    
    .category-title {
        font-size: 1.5rem;
        font-weight: 700;
    }
    
    .subject-links {
        gap: 25px;
    }
    
    .grid-container {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .course-tile {
        min-height: 160px;
    }
    
    .course-title {
        font-size: 1.25rem;
    }
    
    .course-desc {
        -webkit-line-clamp: 2;
        font-size: 0.95rem;
    }
}

@media (min-width: 1440px) {
    .desktop-subjects-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.2rem;
    }
    
    .desktop-subject-card {
        min-height: 320px;
    }
    
    .subject-card-title {
        font-size: 2rem;
    }
}

@media (max-width: 767px) {
    /* HIDE DESKTOP VIEW ON MOBILE */
    .desktop-subjects-view {
        display: none !important;
    }
    
    .tutorials-header {
        padding: 0.8rem 1rem;
    }
    
    .tutorials-logo-text {
        font-size: 1.2rem;
    }
    
    .tutorials-logo {
        width: 32px;
        height: 32px;
    }
    
    .tutorials-nav-menu {
        top: 60px;
    }
}

@media (max-width: 480px) {
    .nav-section {
        height: 12vh;
        min-height: 85px;
        max-height: 120px;
    }
    
    .category-header {
        padding: 10px 12px;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    .toggle-icon {
        font-size: 0.8rem;
    }
    
    .subject-link-item {
        padding: 8px 12px 8px 20px;
    }
    
    .subject-link-item:hover {
        padding-left: 24px;
    }
    
    .link-arrow {
        right: 12px;
    }
    
    .banner-footer-nav {
        height: 34px;
    }
    
    .subject-links {
        gap: 10px;
        padding: 0 15px;
    }
    
    .subject-link {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .welcome-section {
        margin-bottom: 10px;
        padding-top: 0.8rem;
    }
    
    .main-content-area {
        padding: 4px 12px 12px 12px;
    }
    
    .course-tile {
        min-height: 180px;
    }
    
    .course-title {
        font-size: 1.1rem;
    }
    
    .course-desc {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
    
    .course-content {
        padding: 16px 12px;
    }
}

@media (min-height: 800px) {
    .nav-section {
        height: 18vh;
        max-height: 180px;
    }
}

@media (max-width: 360px) {
    .welcome-section h1 {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }
    
    .welcome-section p {
        font-size: 0.85rem;
    }
    
    .category-title {
        font-size: 1rem;
    }
    
    .subject-name {
        font-size: 0.8rem;
    }
    
    .subject-link {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .subject-links {
        animation: none !important;
    }
    
    .loading-spinner {
        animation: none !important;
    }
    
    .course-tile:hover {
        transform: none !important;
    }
    
    .desktop-subject-card:hover {
        transform: none !important;
    }
    
    .desktop-subject-card:hover .desktop-tile-cta {
        transform: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .tutorials-header {
        border-bottom: 2px solid #000;
    }
    
    .tutorials-nav-item.tutorials-active {
        outline: 2px solid #000;
    }
    
    .category-header {
        border: 2px solid #fff;
    }
    
    .subject-link-item {
        border: 1px solid #000;
    }
    
    .subject-link {
        border: 1px solid #fff;
    }
}

/* Print styles */
@media print {
    .tutorials-header,
    .banner-footer-nav,
    .tutorials-menu-toggle,
    .course-tile::before,
    .desktop-subjects-view {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .course-tile {
        break-inside: avoid;
        page-break-inside: avoid;
        background: #f5f5f5 !important;
        border: 1px solid #ddd;
    }
    
    .course-title {
        color: black !important;
        text-shadow: none !important;
    }
    
    .course-desc {
        color: #333 !important;
        text-shadow: none !important;
    }
    
    .category-header {
        background: #eee !important;
        color: black !important;
    }
    
    .category-title {
        color: black !important;
    }
}