:root {
    --primary-color: #3b82f6;
    --secondary-color: #1e40af;
    --background-color: #0f172a;
    --text-color: #f1f5f9;
    --accent-color: #f472b6;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --slide-bg: #1e293b;
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
    /* Prevent scrolling, handle navigation via JS */
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+/Edge */
    user-select: none;
    /* Standard */
}

#presentation-container {
    width: 90%;
    height: 90%;
    position: relative;
    background-color: var(--slide-bg);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    /* Optimize render performance */
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, visibility 0.5s;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transform: translateX(100px);
    pointer-events: none;
    /* Prevent interaction when not active */
}

.slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: all;
    z-index: 10;
}

.slide.scrollable-slide {
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: 5rem;
}

.slide.prev {
    transform: translateX(-100px);
}

h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vmin, 4.5rem);
    margin-bottom: 2vmin;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

h2 {
    font-size: clamp(2rem, 5vmin, 3.5rem);
    color: var(--primary-color);
    margin-bottom: 2vmin;
}

p,
li {
    font-size: clamp(1.4rem, 3.5vmin, 2rem);
    line-height: 1.5;
    max-width: 95%;
    /* Slightly wider to accommodate larger text */
    margin-bottom: 1.2vmin;
    color: #cbd5e1;
}

ul {
    list-style-type: none;
    text-align: left;
}

li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.highlight {
    color: var(--accent-color);
    font-weight: bold;
}

.slide-number {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 1rem;
    color: #64748b;
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
    z-index: 20;
}

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

#prev-btn {
    left: 20px;
}

#next-btn {
    right: 20px;
}

#close-presentation-btn {
    position: absolute;
    top: 25px;
    right: 35px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#close-presentation-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    transform: rotate(90deg);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

/* Quiz Styling */
.quiz-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 2rem;
    border-radius: 15px;
    width: 80%;
    max-width: 900px;
    text-align: left;
}

.question {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-btn {
    background: #334155;
    border: 1px solid #475569;
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.option-btn:hover {
    background: #475569;
}

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

.option-btn.correct {
    background: var(--success-color);
    border-color: var(--success-color);
}

.option-btn.wrong {
    background: var(--error-color);
    border-color: var(--error-color);
}

.check-answer-btn {
    margin-top: 1rem;
    padding: 10px 20px;
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.feedback {
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    min-height: 1.5em;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

iframe {
    width: 80%;
    height: 50vh;
    /* Reduced slightly to fit better */
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 50;
    /* Ensure it is on top */
    position: relative;
    /* Needed for z-index */
}

/* Slide Images */
.slide-image {
    max-width: 90%;
    max-height: 35vh;
    /* Responsive height */
    margin: 1.5vmin auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 195, 255, 0.3);
    transition: transform 0.3s ease;
    object-fit: contain;
}

.slide-image:hover {
    transform: scale(1.02);

}

/* Drag and Drop Game Styles */
#drag-game-container {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.scenarios {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scenario-item {
    background: linear-gradient(135deg, #00c6fb 0%, #005bea 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: grab;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.scenario-item:active {
    cursor: grabbing;
}

.drop-zones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drop-zone {
    width: 200px;
    height: 50px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
}

.drop-zone.drag-over {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00c6fb;
    color: white;
}

.drop-zone.correct {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #2ecc71;
}

.drop-zone.wrong {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Make images smaller on mobile */
@media (max-width: 768px) {
    .slide-image {
        max-height: 180px;
    }
}

/* Topology Game Styles */
.drop-zones-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.drop-zone-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
}

.game-img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 5px;
    border-radius: 5px;
}

.drop-zone-item .drop-zone {
    min-height: 40px;
    font-size: 0.8rem;
    padding: 5px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.drop-zone-item .drop-zone.drag-over {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00c6fb;
}

.draggable-items {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.draggable {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    color: #333;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: grab;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.draggable:active {
    cursor: grabbing;
}

.game-feedback {
    margin-top: 15px;
    font-weight: bold;
    font-size: 1.1rem;
    min-height: 1.5em;
}

.reset-game-btn {
    background: #ff6b6b;
    border: none;
    padding: 8px 16px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

/* Connection Game */
.conn-game-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
}

.conn-pair {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
}

.conn-icons {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.conn-drop-zone {
    width: 100%;
    height: 60px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    transition: all 0.3s;
}

.conn-drop-zone.drag-over {
    border-color: #00c6fb;
    background: rgba(255, 255, 255, 0.1);
}

.conn-drop-zone.correct {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

/* OSI Ordering Game */
.osi-game-container {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 2rem;
    width: 100%;
}

.osi-mixed-layers,
.osi-target-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
}

.osi-layer-card {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: grab;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    font-size: 1.1rem;
}

.osi-layer-card:active {
    cursor: grabbing;
}

.osi-slot {
    height: 45px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.osi-slot.drag-over {
    background: rgba(255, 255, 255, 0.1);
    border-color: #f59e0b;
}

.osi-slot.correct {
    background: #10b981;
    color: white;
    border: none;
}

.osi-slot.wrong {
    background: #ef4444;
}

/* IP Class Game */
.ip-game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.random-ip-display {
    font-size: 3.5rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #00c6fb;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 3rem;
    border-radius: 15px;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(0, 198, 251, 0.2);
}

.ip-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.ip-class-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.ip-class-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.ip-class-btn.correct-choice {
    background: #2ecc71;
    border-color: #2ecc71;
}

.ip-class-btn.wrong-choice {
    background: #e74c3c;
    border-color: #e74c3c;
}