:root {
    --primary-color: rgba(61, 208, 255, 1);
    --background-color: rgb(18, 56, 93);
    --breadcrumb-color: rgba(255, 255, 255, 0.5);
    --breadcrumb-hover-color: rgba(255, 255, 255, 1);
    --button-background: rgb(79, 114, 150);
    --button-color: rgba(255, 255, 255, 0.8);
    --button-padding: 10px 20px;
    --card-background: #ffffff;
    --card-text-color: rgba(0, 0, 0, 0.8);
    --colors-blueLighter: rgba(177, 198, 220, 1);
    --navbar-background: rgb(33, 74, 116);
    --text-color: rgba(255,255,255, 1);
    --navbar-text-color: rgba(255, 255, 255, 0.8);
    --navbar-height: 60px;
    --tabbar-height: 56px;
    --progress-bar-background-color: rgba(0,0,0,0.1);
    --progress-bar-fill-color: var(--primary-color);
    --border-radius-md: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}
button {
    background-color: var(--button-background);
    border: 1px solid transparent;
    color: var(--button-color);
    cursor: pointer;
    padding: var(--button-padding);
    border-radius: var(--border-radius-md);
    height: 48px;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: bold;
}
button:hover {
    background-color: var(--primary-color);
}
button.active {
    background-color: var(--primary-color);
    color: var(--background-color);
}
.main-container h1 {
    font-size: 1.0rem;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: start;
    text-transform: uppercase;
}
h2 {
    font-size: 1rem;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: start;
    text-transform: uppercase;
}
.hide-on-small-screen {
    display: none;
}
.text-right {
    text-align: right;
}
.mb-2 {
    margin-bottom: 0.5rem;
}
.mb-4 {
    margin-bottom: 1rem;
}
.main-container-header .breadcrumb-item,
.main-container-header .breadcrumb-separator {
    font-size: 0.6rem;
}
.main-container-header a {
    color: var(--breadcrumb-color);
    transition: color 0.2s linear;
}
.main-container-header a:hover,
.main-container-header a:active,
.main-container-header a:focus {
    color: var(--breadcrumb-hover-color);
}

.flex-container {
    align-items: center;
    display: flex;
    flex-direction: row;
}

.flex-container .column-1 {
    flex: 1;
}

.flex-container .column-2 {
    width: 80px;
    flex-shrink: 0;
    text-align: right;
}
.column-1 > *, .column-2 > * {
    flex: 1;
}

/* Navbar styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background-color: var(--navbar-background);
    color: var(--navbar-text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.logo-button {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 32px;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar h1 {
    font-size: 1.2rem;
}


/* Hamburger menu styles */
.menu-container {
    position: relative;
}

.hamburger-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    position: relative;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--navbar-text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Hamburger animation */
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-5px);
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.menu-dropdown {
    background-color: var(--card-background);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    color: var(--card-text-color);
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    padding: 8px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-dropdown a {
    color: var(--card-text-color);
    display: block;
    padding: 12px 24px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.menu-dropdown a:hover {
    background-color: rgba(0,0,0,0.05);
}


/* Breadcrumbs styles */
.breadcrumb-item {
    color: var(--text-color);
    text-decoration: none;
}

a.breadcrumb-item {
    cursor: pointer;
}

a.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-color);
    opacity: 0.7;
}


/* Main content and page template styles */
.main-container {
    min-height: calc(100vh - var(--navbar-height));
    position: relative;
    padding-inline: 1rem;
    width: 100%;
    overflow-x: hidden;
}
.main-content {
    align-items: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-inline: auto;
    margin-top: var(--navbar-height);
    max-width: 1344px;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .main-content {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 16px;
    }
    .main-container h1 {
        font-size: 1.5rem;
    }
}
@media screen and (min-width: 1440px) {
    .main-content {
        gap: 48px;
        padding-inline: unset;
    }
}

/* Position the lesson template container */
.lesson-template {
    background: var(--background-color);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: calc(100vh - var(--navbar-height));
    opacity: 0;
    transition: opacity 0.3s linear;
    z-index: 10;
}

.lesson-template.out-of-view {
    opacity: 0;
    left: 150%;
}

.lesson-template.fade-in {
    opacity: 1;
}



/* Card styles */
.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-md);;
    color: var(--card-text-color);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.chapters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
    opacity: 1;
    transition: opacity 150ms linear;
}
.card.chapter-card {
    cursor: pointer;
    padding: 16px;
    -webkit-tap-highlight-color: transparent;
}
.card.chapter-card .chapter-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 280px;
    justify-content: space-between;
}
.card.chapter-card .chapter-content .chapter-heading {
    background-color: var(--colors-blueLighter);
    border-radius: var(--border-radius-md);;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: space-between;
    padding: 1.125rem;
}
.card.chapter-card .chapter-content .chapter-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.card.chapter-card .chapter-content .chapter-progress .progress-bar {
    border-radius: var(--border-radius-md);;
    width: 100%;
    height: 10px;
    background-color: var(--progress-bar-background-color);
}
.card.chapter-card .chapter-content .chapter-progress .progress-bar .progress-bar-fill {
    border-radius: var(--border-radius-md);;
    height: 100%;
    background-color: var(--primary-color);
    width: 50%;
}

.card.section-card {
    padding: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.card.section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card.section-card .section-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


/* Subject list styles */
.subjects-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    position: relative;
    max-width: 100vw;
}

.subjects-wrapper {
    overflow-x: hidden;
    width: 100%;
}

.subjects-list {
    display: flex;
    gap: 0.5rem;
    transition: transform 0.3s ease;
    overflow-x: auto;
}

.subject-btn {
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, opacity 0.2s;
    opacity: 1;
    color: white;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-btn:disabled {
    cursor: default;
    opacity: 0.5;
    background-color: transparent;
}

.nav-btn .material-icons {
    color: white;
}


/* Add these new styles */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

.nav-icon {
    height: 100%;
    padding: 0 8px;
    display: flex;
    align-items: center;
    color: var(--navbar-text-color);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.nav-icon i.material-icons {
    font-size: 30px;
}

.nav-icon:hover {
    opacity: 1;
}

.nav-icon.active {
    opacity: 1;
    color: var(--primary-color);
}

/* Add new media query for large screens */
@media (min-width: 768px) {
    /* Adjust subjects container for vertical layout */
    .subjects-container {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .subjects-wrapper {
        overflow-y: auto;
        max-height: calc(100vh - var(--navbar-height) - 32px);
    }
    .subjects-wrapper h2 {
        display: flex;
        align-items: center;
        justify-content: start;
        text-transform: uppercase;
    }

    .subjects-list {
        flex-direction: column;
        gap: 8px;
    }

    .subject-btn {
        width: 100%;
        text-align: left;
    }

    /* Hide navigation buttons on desktop */
    .nav-btn {
        display: none;
    }
}

.chapters-scroll-container {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 1rem calc(50% - 150px);
    margin: 0 -1rem;
    scroll-padding: 0 calc(50% - 135px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chapters-scroll-container::-webkit-scrollbar {
    display: none;
}

.chapter-card {
    flex: 0 0 300px;
    margin: 0 0.2rem;
    scroll-snap-align: center;
    transform: scale(0.8);
    transform-origin: center center;
    transition: transform 0.3s linear;
    will-change: transform;
}

.chapter-card:first-child {
    transform: scale(1);
}

.chapter-card:is(:target, :focus-within) {
    transform: scale(1);
}

.chapter-content {
    transform-origin: center center;
    transition: transform 0.3s linear;
}

/* Desktop styles */
@media (min-width: 769px) {
    .chapters-scroll-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        padding: 0;
        margin: 0;
        overflow-x: visible;
        scroll-snap-type: none;
        width: 100%;
    }

    .chapter-card {
        flex: none;
        margin: 0;
        transform: none !important;
        width: 300px;
    }

    .chapter-card:first-child {
        transform: none;
    }

    .chapter-card:is(:target, :focus-within) {
        transform: none;
    }

    .chapter-content {
        transform: none;
    }

    .hide-on-small-screen {
        display: block;
    }
}

/* Add larger screen optimization */
@media (min-width: 1440px) {
    .chapters-scroll-container {
        gap: 2rem;
    }
}

.card.lesson-card {
    padding: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.card.lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card.lesson-card .lesson-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.free-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Lesson template styles */
.video-container {
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: start;
    margin: 0 auto 1rem auto;
    gap: 1rem;
    min-height: 244px;
}
.video-wrapper {
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    max-width: 450px;
    overflow: hidden;
    position: relative;
}
.lesson-video {
    position: relative;
    z-index: 1;
}
.video-wrapper video {
    z-index: 2;
}
@media screen and (min-width: 1440px) {
    .video-wrapper {
        min-width: 450px;
    }
}
@media screen and (min-width: 768px) {
    .main-container-header .breadcrumb-item,
    .main-container-header .breadcrumb-separator {
        font-size: 1rem;
    }
    .video-container {
        aspect-ratio: 16 / 10;
        max-width: calc(100vw - 30px);
        flex-direction: row;
    }
}
.lesson-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s linear;
}
.quiz-info {
    align-items: center;
    align-self: start;
    background-color: var(--navbar-background);
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.125rem;
    min-height: 257px;
    padding: 0.625rem;
    min-width: calc(100vw - 30px);
    text-align: center;
}
@media screen and (min-width: 1440px) {
    .video-wrapper {
        max-width: 450px;
    }
    .quiz-info {
        min-width: 250px;
        max-width: 400px;
    }
}
@media screen and (min-width: 300px) {
    .quiz-info {
        padding-top: 2rem;
    }
}

.block-button {
    display: block;
    width: 100%;
}

/* Add these new ripple effect styles */
.ripple {
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    -webkit-tap-highlight-color: transparent;
}

.ripple::after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .5s, opacity 1s;
}

.ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Settings Modal Styles */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.settings-modal {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background-color: var(--card-background);
    border-radius: var(--border-radius-md);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s linear;
}

.settings-overlay.active {
    opacity: 1;
    visibility: visible;
}

.settings-modal.active {
    opacity: 1;
    top: 10%;
}

.settings-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    color: var(--card-text-color);
    font-weight: 500;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch label:after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked + label {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + label:after {
    transform: translateX(24px);
}

.settings-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .settings-modal {
        width: 100%;
        height: 100%;
        max-width: none;
    }
    
    .settings-modal.active {
        top: 0;
    }
    
    .settings-content {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* Add these new styles for the custom language selector */
.language-selector {
    position: relative;
}

.custom-select {
    position: relative;
    width: 200px;
}

.select-trigger {
    /* background-color: var(--background-color); */
    border: 1px solid var(--background-color);
    color: var(--card-text-color);
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.select-trigger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.options-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: var(--card-background);
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.custom-select.active .options-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--card-text-color);
}

.option:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.option.selected {
    background-color: var(--primary-color);
    color: white;
}

/* Custom scrollbar for the options list */
.options-list::-webkit-scrollbar {
    width: 8px;
}

.options-list::-webkit-scrollbar-track {
    background: transparent;
}

.options-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.options-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .custom-select {
        width: 160px;
    }
}


/* ------------------------------------ */
/* Camera Styles                        */
/* ------------------------------------ */

/* Camera button styles */
.camera-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: white;
    cursor: pointer;
}
.camera-button:hover {
    color: var(--primary-color);
}

/* Photo preview modal styles */
.photo-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.photo-preview-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    z-index: 1001;
    width: 90%;
    max-width: 500px;
}

.photo-preview-content {
    padding: 16px;
}

#photo-preview {
    width: 100%;
    height: auto;
    margin-bottom: 16px;
}

.photo-preview-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Add these loader styles */
.loader-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.loader {
    width: 48px;
    height: 48px;
    position: relative;
}

.loader:before,
.loader:after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: pulse 1.8s ease-in-out infinite;
    filter: drop-shadow(0 0 1rem rgba(61, 208, 255, 0.5));
}

.loader:before {
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    animation-delay: -0.9s;
}

.loader:after {
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    animation-delay: 0s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Add this to ensure proper positioning */
.photo-preview-content {
    position: relative;
}

.video-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Mobile Sections Layout */
@media (max-width: 768px) {
    .sections-scroll-container {
        display: flex;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 1rem calc(50% - 150px);
        margin: 0 -1rem;
        scroll-padding: 0 calc(50% - 135px);
        
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sections-scroll-container::-webkit-scrollbar {
        display: none;
    }

    .section-card {
        flex: 0 0 300px;
        margin: 0 0.2rem;
        scroll-snap-align: center;
        transform: scale(0.8);
        transform-origin: center center;
        transition: transform 0.3s linear;
        will-change: transform;
    }

    .section-card:first-child {
        transform: scale(1);
    }

    .section-card:is(:target, :focus-within) {
        transform: scale(1);
    }

    .section-content {
        transform-origin: center center;
        transition: transform 0.3s linear;
    }
}

/* Desktop Sections Layout */
@media (min-width: 769px) {
    .sections-scroll-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        padding: 0;
        margin: 0;
        overflow-x: visible;
        scroll-snap-type: none;
        width: 100%;
    }

    .section-card {
        flex: none;
        margin: 0;
        transform: none !important;
        width: 300px;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .section-card:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
}

/* Larger screen optimization */
@media (min-width: 1440px) {
    .sections-scroll-container {
        gap: 2rem;
    }
}