/* ============================================
   STYLES.CSS - WEB PEMBELAJARAN INFORMATIKA
   ============================================ */

/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: #333;
    padding-bottom: 60px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header a {
    color: #ffd700;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

header a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Navigation Styles */
nav {
    background-color: #fff;
    padding: 20px;
    margin: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

nav h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

nav li {
    display: inline-block;
}

nav a {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Main Content Styles */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.intro {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.intro h2 {
    color: #667eea;
    margin-bottom: 10px;
}

/* Materi Card Styles */
.materi-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.materi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.materi-card h3 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.materi-card h4 {
    color: #764ba2;
    margin: 15px 0 10px;
    font-size: 1.1em;
}

.materi-card ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.materi-card li {
    margin-bottom: 8px;
}

.materi-card strong {
    color: #667eea;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Quiz Button */
.quiz-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Summary Section */
.summary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin: 25px 0;
}

.summary h2 {
    margin-bottom: 15px;
}

.summary ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.summary li {
    margin-bottom: 8px;
}

/* Class Navigation */
.class-nav {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 25px 0;
}

.class-nav h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #667eea;
}

.class-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
}

.class-nav ul li {
    list-style: none;
}

.class-nav ul li strong {
    display: inline-block;
    padding: 8px 12px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    font-size: 14px;
    margin-right: 5px;
}

.class-nav a {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.class-nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

/* ============================================
   IKLAN SPACES (AdSense)
   ============================================ */
.ad-space-top,
.ad-space-middle,
.ad-space-bottom {
    width: 100%;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
}

.ad-placeholder {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    max-width: 728px;
    margin: 0 auto;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder p {
    color: #999;
    font-style: italic;
}

/* Style untuk iklan yang sudah aktif (nanti diganti) */
.ad-space-top ins.adsbygoogle,
.ad-space-middle ins.adsbygoogle,
.ad-space-bottom ins.adsbygoogle {
    display: block;
    margin: 20px auto;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    position: relative;
    width: 100%;
}

footer a {
    color: #ffd700;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ============================================
   MODAL QUIZ & LEADERBOARD
   ============================================ */
.quiz-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.quiz-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.quiz-modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.quiz-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

#quizProgress {
    color: #764ba2;
    font-weight: 600;
    margin-top: 10px;
}

.quiz-content {
    margin: 20px 0;
}

#quizQuestion {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #333;
    font-weight: 500;
}

#quizOptions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option-btn {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.quiz-option-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f5f7ff;
    transform: translateX(5px);
}

.quiz-option-btn.correct {
    border-color: #4CAF50;
    background: #e8f5e9;
    color: #2E7D32;
    font-weight: bold;
}

.quiz-option-btn.wrong {
    border-color: #f44336;
    background: #ffebee;
    color: #c62828;
}

.quiz-option-btn:disabled {
    cursor: default;
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    margin: 20px 0;
}

.score-display {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.percentage-display {
    font-size: 3em;
    font-weight: bold;
    margin: 15px 0;
}

.message {
    font-size: 1.2em;
    opacity: 0.95;
}

/* Leaderboard */
.leaderboard-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.leaderboard-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
}

.leaderboard-list li {
    padding: 10px 15px;
    margin: 8px 0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.leaderboard-list .medal {
    margin-right: 10px;
    font-size: 1.2em;
}

/* All Leaderboard Modal */
#leaderboardModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#leaderboardContent {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

#leaderboardContent h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 20px;
}

.all-leaderboard {
    list-style: none;
    padding: 0;
}

.all-leaderboard li {
    padding: 12px 18px;
    margin: 10px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.all-leaderboard .medal {
    margin-right: 12px;
    font-size: 1.3em;
    min-width: 30px;
}

.all-leaderboard .quiz-type {
    font-size: 0.85em;
    color: #666;
    margin-left: auto;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

/* Quiz Buttons in Modal */
.quiz-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.quiz-buttons .quiz-btn {
    padding: 12px 30px;
}

/* ============================================
   RESPONSIVE QUIZ
   ============================================ */
@media (max-width: 768px) {
    .quiz-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    #quizQuestion {
        font-size: 1.1em;
    }
    
    .quiz-option-btn {
        padding: 12px 15px;
        font-size: 0.95em;
    }
    
    .percentage-display {
        font-size: 2.5em;
    }
    
    .quiz-buttons {
        flex-direction: column;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.materi-card {
    animation: fadeIn 0.5s ease-out;
}

.materi-card:nth-child(2) { animation-delay: 0.1s; }
.materi-card:nth-child(3) { animation-delay: 0.2s; }
.materi-card:nth-child(4) { animation-delay: 0.3s; }
.materi-card:nth-child(5) { animation-delay: 0.4s; }

