:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-primary: #8b5cf6;
    --accent-secondary: #06b6d4;
    --glass-bg: rgba(30, 41, 59, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
}

/* ... existing code ... */

/* Body & Global */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

/* Slides */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    /* When becoming inactive: fade out opacity, then hide visibility after 0.6s */
    transition: opacity 0.6s ease, transform 0.6s ease, visibility 0s 0.6s;
    transform: scale(0.95) translateY(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    z-index: 0;
    pointer-events: none;
    box-sizing: border-box;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    z-index: 10;
    pointer-events: all;
    /* When becoming active: show visibility immediately, then fade in */
    transition: opacity 0.6s ease, transform 0.6s ease, visibility 0s 0s;
}

/* Typography & Content */
.content-center {
    text-align: center;
}

.main-title {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.gr-text {
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 2rem;
    color: #94a3b8;
    font-weight: 300;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    width: 80%;
    max-width: 1200px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--accent-secondary);
    border-bottom: 2px solid rgba(6, 182, 212, 0.3);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Feature Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.text-content p {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
}

.feature-list li::before {
    content: "➜";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.icon-display {
    font-size: 8rem;
    text-align: center;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
}

.info-card h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* Usage Grid */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.usage-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.emoji {
    font-size: 2rem;
}

/* Timeline */
.timeline {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 0;
}

.timeline-item {
    position: relative;
    z-index: 1;
    background: #0f172a;
    border: 2px solid var(--accent-secondary);
    border-radius: 50%;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    transition: transform 0.3s;
}

.timeline-item:hover {
    transform: scale(1.1);
    background: var(--accent-secondary);
    color: #0f172a;
}

.year {
    font-weight: 800;
    font-size: 1.5rem;
}

.desc {
    font-size: 0.9rem;
}

/* Code Blocks */
pre {
    background: #1e1e1e !important;
    border-radius: 12px;
    margin-top: 1rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
}

.progress {
    height: 100%;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    width: 0%;
    transition: width 0.3s ease;
}

.slide-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 1.2rem;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

/* Quiz Styles */
.quiz-container {
    text-align: center;
    margin-top: 2rem;
}

.question {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.options-grid button:last-child:nth-child(odd) {
    grid-column: span 2;
    /* Center the 5th item if odd */
}

.nav-quiz-btn {
    background: rgba(15, 23, 42, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-quiz-btn:hover {
    background: var(--accent-primary);
}

.option-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-secondary);
    color: white;
    padding: 1.5rem;
    font-size: 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background: var(--accent-secondary);
    color: #0f172a;
    transform: translateY(-5px);
}

.option-btn.correct {
    background-color: #22c55e !important;
    border-color: #22c55e !important;
    color: white !important;
}

.option-btn.wrong {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
}

.feedback {
    font-weight: bold;
}

/* Navigation Buttons */
.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.6);
    /* Darker background */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 2rem;
    padding: 1rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.nav-btn:hover {
    background: var(--accent-secondary);
    color: #0f172a;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 2rem;
}


.next-btn {
    right: 2rem;
}

/* --- Hangman Game --- */
.hangman-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

#hangman-svg {
    stroke: var(--text-primary);
    stroke-width: 4;
    fill: none;
}

#keyboard button {
    padding: 0.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#keyboard button:hover:not([disabled]) {
    background: var(--accent-primary);
    color: black;
}

#keyboard button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Drag & Drop Game --- */
.draggable {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: grab;
    margin-bottom: 0.5rem;
    transition: transform 0.2s;
}

.draggable:active {
    cursor: grabbing;
}

.dropzone {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: background 0.3s;
}

.dropzone.drag-over {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--accent-primary);
}

.dropzone.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.3);
}

/* --- Memory Game --- */
.memory-grid {
    perspective: 1000px;
}

.memory-card {
    background: transparent;
    cursor: pointer;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.front-face,
.back-face {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    margin-bottom: 2rem;
}

.options-grid button:last-child:nth-child(odd) {
    grid-column: span 2;
    /* Center the 5th item if odd */
}

.nav-quiz-btn {
    background: rgba(15, 23, 42, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-quiz-btn:hover {
    background: var(--accent-primary);
}

.option-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-secondary);
    color: white;
    padding: 1.5rem;
    font-size: 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background: var(--accent-secondary);
    color: #0f172a;
    transform: translateY(-5px);
}

.option-btn.correct {
    background-color: #22c55e !important;
    border-color: #22c55e !important;
    color: white !important;
}

.option-btn.wrong {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
}

.feedback {
    font-weight: bold;
}

/* Navigation Buttons */
.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.6);
    /* Darker background */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 2rem;
    padding: 1rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.nav-btn:hover {
    background: var(--accent-secondary);
    color: #0f172a;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 2rem;
}


.next-btn {
    right: 2rem;
}

/* --- Hangman Game --- */
.hangman-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

#hangman-svg {
    stroke: var(--text-primary);
    stroke-width: 4;
    fill: none;
}

#keyboard button {
    padding: 0.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#keyboard button:hover:not([disabled]) {
    background: var(--accent-primary);
    color: black;
}

#keyboard button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Drag & Drop Game --- */
.draggable {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: grab;
    margin-bottom: 0.5rem;
    transition: transform 0.2s;
}

.draggable:active {
    cursor: grabbing;
}

.dropzone {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: background 0.3s;
}

.dropzone.drag-over {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--accent-primary);
}

.dropzone.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.3);
}

/* --- Memory Game --- */
.memory-grid {
    perspective: 1000px;
}

.memory-card {
    background: transparent;
    cursor: pointer;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.front-face,
.back-face {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    font-size: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.front-face {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    /* transform removed, should be visible initially */
}

.back-face {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-size: 2.5rem;
    transform: rotateY(180deg);
    /* Hidden initially */
}

/* Dark Mode Toggle Style */
body.dark-mode {
    background-color: #f1f5f9;
    color: #0f172a;
}

body.dark-mode .glass-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .main-title {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode h2,
body.dark-mode h3 {
    color: var(--accent-primary);
}
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    color: #333;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: var(--accent-primary);
    text-decoration: none;
    cursor: pointer;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
}

.example-btn {
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.example-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.4);
}
