@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    /* Dark Theme Palette */
    --primary-color: #58a6ff;
    --secondary-color: #3fb9a3;
    --text-color: #c9d1d9;
    --light-text-color: #f0f0f0;
    --background-color: #0d1117;
    --card-bg: #161b22; /* Used for slide background */
    --border-color: #30363d;
    --input-bg: #0d1117;
    --input-border: #30363d;
    --button-text-color: #0d1117;
    --hover-bg: #1f242c;
    --matched-bg: #2a3038;
    --correct-bg: #1a3d2a;
    --correct-border: #2c6b43;
    --correct-text: #7ee787;
    --incorrect-bg: #4d1c21;
    --incorrect-border: #8d343e;
    --incorrect-text: #ffa198;

    --border-radius: 12px;
    --box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3); /* Stronger shadow for container */
    --transition-speed: 0.4s; /* Slightly slower for slide transitions */
    --animation-duration: 0.5s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%; /* Ensure body takes full height */
    overflow: hidden; /* Prevent scrolling the whole page */
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex; /* Center the presentation */
    justify-content: center;
    align-items: center;
    padding: 1rem; /* Add padding around the container */
}

.presentation-container {
    width: 100%;
    max-width: 1000px; /* Max width of presentation */
    height: 90vh; /* Max height */
    max-height: 700px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Important: clips slide content */
    position: relative; /* For absolute positioning of slides */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 60px); /* Full height minus nav bar */
    padding: 2rem 3rem; /* Padding inside each slide */
    opacity: 0;
    visibility: hidden;
    /* transition: opacity var(--transition-speed) ease-in-out, visibility var(--transition-speed) ease-in-out; */ /* Removed transition, GSAP will handle it */
    overflow-y: auto; /* Allow scrolling within a slide if content overflows */
}

.slide.active-slide {
    /* opacity: 1; */ /* GSAP will handle opacity */
    visibility: visible; /* Still needed to make it occupy space */
    z-index: 1; /* Bring active slide to front */
    /* animation: fadeInSlide var(--transition-speed) ease-in-out forwards; */ /* Removed animation */
}

/* Remove global section styling */
/* section { ... } */

/* Style elements within slides */
.slide header {
    background: none; /* Remove header background */
    color: var(--primary-color);
    padding: 0 0 1.5rem 0; /* Adjust padding */
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    box-shadow: none;
}
.slide header h1, .slide header h2, .slide header h3 {
    font-size: 1.8rem; /* Consistent heading size */
    font-weight: 700;
    color: var(--primary-color);
}
.slide header h3 { /* Slightly smaller for sub-headings */
     font-size: 1.6rem;
}

.slide main {
    /* Remove grid layout from main */
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: block;
    gap: 0;
}

.slide footer { /* Footer specific to the last slide */
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem 0;
    color: #8b949e;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}


/* Adjust list styling for slides */
ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}

li {
    margin-bottom: 1rem; /* More spacing */
    padding-left: 1.8rem;
    position: relative;
    /* Remove individual li animation if slide transition is preferred */
    /* animation: ... */
    /* opacity: 1; */
    /* animation-delay: ... */
}

li::before {
    content: '>'; /* Use arrow for presentation feel */
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
    top: 2px;
}

strong {
    font-weight: 600;
    color: var(--secondary-color);
}

em {
    color: #8b949e;
    font-style: italic;
}

.lesson-image {
    display: block;
    max-width: 60%; /* Make image smaller */
    height: auto;
    border-radius: var(--border-radius);
    margin: 2rem auto; /* Center image */
    border: 1px solid var(--border-color);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
.intro-image {
     max-width: 50%; /* Even smaller for intro */
}


/* Navigation Styling */
.slide-nav {
    height: 60px; /* Fixed height for nav bar */
    background-color: var(--background-color); /* Slightly different bg */
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: absolute; /* Stick to bottom */
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2; /* Above slides */
}

.slide-nav button {
    background-color: var(--primary-color);
    color: var(--button-text-color);
    border: none;
    padding: 0.6rem 1.2rem; /* Smaller padding */
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    margin-top: 0; /* Remove margin */
}

.slide-nav button:hover:not(:disabled) {
    background-color: #76baff;
    transform: translateY(-2px);
}

.slide-nav button:disabled {
    background-color: var(--border-color);
    color: #6e7681;
    cursor: not-allowed;
    transform: none;
}

#slide-counter {
    font-size: 0.9rem;
    color: #8b949e;
    font-weight: 600;
}


/* Practice Section Specific Styles (within slides) */
#matching-exercise, #fill-blank-exercise {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--background-color); /* Slightly different bg for exercises */
}

#vietnamese-words, #english-words {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Reduced gap */
    margin-bottom: 1rem;
    padding: 0.8rem;
    background-color: var(--card-bg); /* Match slide bg */
    border: 1px dashed var(--border-color);
    border-radius: 8px; /* Smaller radius */
    min-height: 50px;
}

.word-item {
    padding: 8px 12px; /* Smaller padding */
    background-color: var(--hover-bg); /* Use hover bg as base */
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    font-size: 0.95rem;
}

.word-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    background-color: var(--card-bg);
}

.word-item.selected {
    background-color: var(--primary-color);
    color: var(--button-text-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
}

.word-item.matched {
    opacity: 0.7;
    cursor: default;
    background-color: var(--matched-bg);
    border-color: var(--border-color);
    pointer-events: none;
    transform: none;
    box-shadow: none;
}


#matching-result, #fill-blank-result {
    margin-top: 1rem;
    font-weight: 600;
    padding: 0.6rem; /* Smaller padding */
    border-radius: 6px;
    text-align: center;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.correct {
    color: var(--correct-text);
    background-color: var(--correct-bg);
    border-color: var(--correct-border);
}

.incorrect {
    color: var(--incorrect-text);
    background-color: var(--incorrect-bg);
    border-color: var(--incorrect-border);
}

/* Fill in the blank styles */
.fill-blank-question {
    margin-bottom: 1rem;
    padding: 0.8rem; /* Smaller padding */
    background-color: transparent; /* Remove extra background */
    border: none;
    border-radius: 0;
}

.fill-blank-question label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    line-height: 1.8;
}

.fill-blank-question input[type="text"] {
    padding: 8px 10px; /* Smaller padding */
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    border-radius: 6px;
    margin: 0 5px;
    min-width: 100px; /* Smaller min-width */
    font-size: 0.95rem;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.fill-blank-question input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.fill-blank-question input[type="text"].correct-input {
    border-color: var(--correct-border);
    background-color: rgba(44, 107, 67, 0.1);
}

.fill-blank-question input[type="text"].incorrect-input {
    border-color: var(--incorrect-border);
     background-color: rgba(141, 52, 62, 0.1);
}


/* Responsive Design Adjustments for Presentation */
@media (max-width: 768px) {
    body {
        padding: 0.5rem; /* Less padding on smaller screens */
        align-items: flex-start; /* Align container to top */
    }
    .presentation-container {
        height: 95vh; /* Take more height */
        max-height: none;
    }
    .slide {
        padding: 1.5rem; /* Less padding */
    }
    .slide header h1, .slide header h2, .slide header h3 {
        font-size: 1.5rem;
    }
     .slide header h3 {
        font-size: 1.4rem;
    }
    .lesson-image {
        max-width: 80%;
    }
    .slide-nav {
        padding: 0 1rem;
    }
    .slide-nav button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    #slide-counter {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .slide {
        padding: 1rem;
    }
     .slide header h1, .slide header h2, .slide header h3 {
        font-size: 1.3rem;
    }
     .slide header h3 {
        font-size: 1.2rem;
    }
    li {
        padding-left: 1.5rem;
        margin-bottom: 0.8rem;
    }
    .lesson-image {
        max-width: 90%;
    }
    .slide-nav button {
        padding: 0.4rem 0.8rem;
    }
}
