:root {
    --primary-bg: #444;
    --primary-color: white;
    --secondary-bg: #f4f4f4;
    --secondary-color: #333;
    --hover-bg: #555;
    --accent-color: #ffcc80;
    --secondary-accent: #a7c4a7;
    --tertiary-accent: #80cbc4;
    --fun-red: #ff5733;
    --fun-yellow: #ffd700;
    --fun-blue: #1e90ff;
}

body {
    font-family: 'Quicksand', sans-serif;
    margin: 0;
    line-height: 1.6;
    background-color: var(--secondary-bg);
    color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-title {
    text-align: center;
    padding: 1rem;
    background: var(--primary-bg);
    color: var(--primary-color);
    margin: 0;
    font-size: 2rem;
}

header {
    background: var(--primary-bg);
    color: var(--primary-color);
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
}

header nav ul li a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.2rem;
}

header nav ul li a:hover {
    text-decoration: underline;
}

header nav ul li a.active {
    font-weight: bold;
    text-decoration: underline;
}

.language-toggle {
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    background: var(--hover-bg);
    color: var(--primary-color);
}

.main-container {
    display: flex;
    flex: 1;
}

.sidebar {
    flex: 0 0 200px;
    background: var(--primary-bg);
    color: var(--primary-color);
    height: 100%;
    min-height: calc(100vh - 120px); /* Adjust for header and footer heights */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar ul {
    padding: 0;
    margin: 1rem 0;
    list-style: none;
}

.sidebar ul li a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--hover-bg);
}

.sidebar ul li a:hover {
    background: var(--hover-bg);
}

.sidebar ul li a.active {
    background: var(--hover-bg);
    font-weight: bold;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-container {
        flex-direction: column;
    }
}

.content {
    flex: 1;
    padding: 2rem;
}

/* Index Page Styles */
.content.index {
    background: url('/sazi/img/My_Boys.jpg') no-repeat center center;
    background-size: cover;
}

.gamification {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border: 2px solid var(--fun-red);
}

.gamification p {
    margin: 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--fun-blue);
}

.points-progress {
    width: 100%;
    max-width: 300px;
    background: #ddd;
    border-radius: 5px;
    height: 20px;
    position: relative;
    margin: 0.5rem;
}

.points-progress-bar {
    height: 100%;
    background: var(--fun-yellow);
    border-radius: 5px;
    width: 0%;
    transition: width 0.5s ease;
}

.badge-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    background: var(--fun-yellow);
    color: var(--secondary-color);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.9rem;
    animation: badgePop 0.5s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.leaderboard {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid var(--fun-yellow);
    text-align: center;
}

.leaderboard h3 {
    font-size: 1.5rem;
    color: var(--fun-red);
    margin-bottom: 0.5rem;
}

.leaderboard p {
    font-size: 1.1rem;
    color: var(--fun-blue);
}

.fun-fact-popup, .clock-popup, .quick-test-popup, .timeline-popup, .nickname-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--fun-yellow);
    padding: 2rem;
    border-radius: 15px;
    border: 3px solid var(--fun-red);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    display: none;
    z-index: 1000;
    animation: popupFadeIn 0.5s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.fun-fact-popup p, .nickname-popup p {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.fun-fact-popup button, .clock-popup button, .quick-test-popup button, .timeline-popup button, .nickname-popup button {
    background: var(--fun-blue);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin: 0.5rem;
}

.fun-fact-popup button:hover, .clock-popup button:hover, .quick-test-popup button:hover, .timeline-popup button:hover, .nickname-popup button:hover {
    background: #1c86ee;
}

.nickname-popup input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 1rem;
    width: 80%;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.timeline-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--fun-yellow);
    padding: 2rem;
    border-radius: 15px;
    border: 3px solid var(--fun-red);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    display: none;
    z-index: 1001; /* Increased z-index to ensure it appears above other popups */
    animation: popupFadeIn 0.5s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1rem;
    border: 2px solid var(--fun-blue);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

.dashboard-card:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.dashboard-card h2 {
    font-size: 1.5rem;
    color: var(--fun-red);
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.expand-button {
    background-color: var(--fun-blue);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    align-self: center;
}

.expand-button:hover {
    background-color: #1c86ee;
}

.timeline-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1rem;
    border: 2px solid var(--fun-blue);
}

.timeline-container h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--fun-red);
    text-align: center;
}

.timeline-carousel {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.timeline {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.timeline-item {
    flex: 0 0 33.33%;
    box-sizing: border-box;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.3s ease;
}

.timeline-item:hover {
    border: 2px solid var(--fun-yellow);
}

.timeline-item p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: var(--fun-blue);
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

.timeline-details {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid var(--fun-blue);
    text-align: center;
}

.timeline-details h3 {
    font-size: 1.5rem;
    color: var(--fun-red);
    margin-bottom: 0.5rem;
}

.timeline-details p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.timeline-quiz {
    margin-top: 1rem;
}

.timeline-quiz span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.timeline-quiz input {
    width: 80%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.score-display {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid var(--fun-blue);
    text-align: center;
}

.score-display p {
    font-size: 1.1rem;
    color: var(--fun-blue);
}

.clock-preview {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.clock-analogue {
    width: 200px;
    height: 200px;
    border: 5px solid var(--fun-red);
    border-radius: 50%;
    position: relative;
    background: white;
}

.clock-analogue.small {
    width: 100px;
    height: 100px;
    border-width: 3px;
}

.clock-analogue .hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom;
    background: black;
}

.clock-analogue .hour {
    width: 4px;
    height: 60px;
    background: var(--fun-blue);
}

.clock-analogue.small .hour {
    height: 30px;
}

.clock-analogue .minute {
    width: 3px;
    height: 80px;
    background: var(--fun-red);
}

.clock-analogue.small .minute {
    height: 40px;
}

.clock-analogue .second {
    width: 2px;
    height: 90px;
    background: var(--fun-yellow);
}

.clock-analogue.small .second {
    height: 45px;
}

.clock-analogue .center {
    width: 10px;
    height: 10px;
    background: black;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.clock-analogue.small .center {
    width: 5px;
    height: 5px;
}

.clock-digital {
    text-align: center;
    font-size: 1.5rem;
    color: var(--fun-blue);
    margin-bottom: 0.5rem;
}

#clock-text {
    text-align: center;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.intro-content {
    display: block;
}

.full-content {
    display: none;
}

.read-more {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    font-weight: bold;
}

.read-more:hover {
    background-color: #e6b800;
}

.level-selection {
    margin-bottom: 2rem;
}

.level-selection select {
    padding: 0.75rem;
    font-size: 1.2rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-right: 1rem;
    font-family: 'Quicksand', sans-serif;
}

.level-selection button {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    font-family: 'Quicksand', sans-serif;
}

.level-selection button:hover {
    background-color: #e6b800;
}

.test-section {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.test-question {
    margin-bottom: 1rem;
}

.test-question span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.test-question input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-family: 'Quicksand', sans-serif;
}

.test-question button {
    margin-right: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    font-family: 'Quicksand', sans-serif;
}

.test-question button:hover {
    background-color: #e6b800;
}

.test-feedback {
    color: green;
    font-weight: bold;
    margin-top: 0.5rem;
    display: none;
    font-size: 1.1rem;
}

.test-feedback.visible {
    display: block;
}

.test-actions {
    text-align: center;
    margin-top: 1rem;
}

.start-learning {
    display: none;
    padding: 0.8rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 1rem;
    font-size: 1.2rem;
}

.start-learning.visible {
    display: inline-block;
}

.start-learning:hover {
    background-color: #e6b800;
}

/* Dashboard Styles */
.dashboard {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.dashboard h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Profile Styles */
.profile {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    text-align: center;
}

.profile h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.avatar-selection {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.avatar-option {
    cursor: pointer;
    padding: 0.5rem;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: border 0.3s ease;
}

.avatar-option:hover {
    border: 2px solid var(--accent-color);
}

.avatar-option img {
    width: 100px;
    height: 100px;
    border-radius: 10px;
}

.profile-details {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.profile-details p {
    margin: 0.5rem 0;
}

.profile-details .avatar-img {
    display: block;
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
    border-radius: 10px;
}

/* Class Management Styles */
.class-management {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
}

.class-management h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.class-list, .student-list {
    margin-bottom: 2rem;
}

.class-list h3, .student-list h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Lessons Styles */
.lessons {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
}

.lessons h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.lesson {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Chat Styles */
.chat {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
}

.chat h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.chat-message {
    margin-bottom: 0.5rem;
}

.chat-input {
    display: flex;
    gap: 1rem;
}

.chat-input input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.chat-input button {
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.chat-input button:hover {
    background-color: #e6b800;
}

/* Live Class Styles */
.live-class {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
}

.live-class h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

#jitsi-container {
    width: 100%;
    height: 500px;
    border-radius: 10px;
}

footer {
    text-align: center;
    padding: 1rem 0;
    background: var(--primary-bg);
    color: var(--primary-color);
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        min-height: 150px;
    }

    .dashboard-card h2 {
        font-size: 1.3rem;
    }

    .dashboard-card p {
        font-size: 0.9rem;
    }

    .quick-test-popup, .timeline-popup {
        padding: 1rem;
    }

    .timeline-container {
        padding: 1rem;
    }

    .timeline-container h2 {
        font-size: 1.5rem;
    }

    .timeline-item {
        flex: 0 0 50%;
    }

    .timeline-item p {
        font-size: 0.9rem;
    }

    .clock-analogue {
        width: 150px;
        height: 150px;
    }

    .clock-analogue.small {
        width: 80px;
        height: 80px;
    }

    .clock-digital {
        font-size: 1.2rem;
    }

    #jitsi-container {
        height: 300px;
    }

    header {
        flex-direction: column;
        gap: 1rem;
    }

    header nav ul {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Registration Section Styles */
.registration-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 1rem;
    border: 2px solid var(--fun-blue);
    text-align: center;
}

.registration-section h2 {
    font-size: 1.8rem;
    color: var(--fun-red);
    margin-bottom: 1rem;
}

#registration-category {
    padding: 0.75rem;
    font-size: 1.2rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 1rem;
    font-family: 'Quicksand', sans-serif;
}

.registration-carousel {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.carousel-items {
    display: flex;
    animation: carouselSlide 10s infinite linear;
}

.carousel-item {
    flex: 0 0 100%;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.carousel-item:hover {
    background: rgba(255, 204, 128, 0.3);
}

.carousel-item h3 {
    font-size: 1.5rem;
    color: var(--fun-blue);
    margin-bottom: 0.5rem;
}

.carousel-item p {
    font-size: 1rem;
    color: var(--secondary-color);
}

@keyframes carouselSlide {
    0% { transform: translateX(0); }
    45% { transform: translateX(0); }
    50% { transform: translateX(-100%); }
    95% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

/* Sidebar Quiz Styles */
.sidebar-quiz {
    background: var(--primary-bg);
    padding: 1rem;
    border-top: 1px solid var(--hover-bg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.sidebar-quiz h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

#sidebar-quiz-question {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

#sidebar-quiz-answer {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.sidebar-quiz button {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin: 0.2rem;
}

.sidebar-quiz button:hover {
    background-color: #e6b800;
}
.login-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid var(--fun-blue);
}

.login-section h3 {
    font-size: 1.5rem;
    color: var(--fun-red);
    margin-bottom: 0.5rem;
}

.login-section p {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tab-button {
    background: var(--hover-bg);
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.tab-button.active {
    background: var(--fun-blue);
    color: white;
}

.tab-button:hover {
    background: #666;
}

.tab-content {
    display: block;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--fun-blue);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-group button {
    background: var(--fun-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.form-group button:hover {
    background: #1c86ee;
}

.error-message {
    color: var(--fun-red);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}
.content.about {
    background: url('/sazi/img/Sazi_Grandma.jpg') no-repeat center center;
    background-size: cover;
}
#books-carousel .carousel {
    display: flex;
    flex-direction: row;
    transition: transform 0.5s ease-in-out;
}

#books-carousel .carousel-item {
    flex: 0 0 33.33%; /* Ensure 3 items are visible at a time */
    box-sizing: border-box;
    text-align: center;
    padding: 0.5rem;
}

#books-carousel .carousel-item img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 10px;
}

#books-carousel .carousel-item p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    #books-carousel .carousel-item {
        flex: 0 0 50%; /* Show 2 items on smaller screens */
    }

    #books-carousel .carousel-item img {
        max-width: 150px;
    }

    #books-carousel .carousel-item p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    #books-carousel .carousel-item {
        flex: 0 0 100%; /* Show 1 item on very small screens */
    }
}
