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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: white;
    font-size: 3.5em;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    font-weight: bold;
    letter-spacing: -1px;
}

.section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.quiz-intro {
    text-align: center;
    margin: 40px 0;
}

.quiz-intro p {
    font-size: 1.5em;
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.2);
    padding: 15px 25px;
    border-radius: 25px;
    border: 2px solid rgba(255,255,255,0.3);
}

h2 {
    color: #4a5568;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

h3 {
    color: #4a5568;
    margin: 20px 0 15px 0;
}

input[type="number"], select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:disabled:hover {
    transform: none;
    box-shadow: none;
}

#start-quiz {
    display: block;
    margin: 30px auto;
    font-size: 1.8em;
    padding: 20px 50px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

#start-quiz:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #218838 0%, #1d9b7e 100%);
}

.quiz-header {
    border-bottom: none;
}

.quiz-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.quiz-info span {
    font-weight: 500;
    color: #4a5568;
}

#timer {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
}


.question-container {
    margin: 30px 0;
}

.question-container h3 {
    font-size: 1.3em;
    color: #2d3748;
    margin-bottom: 20px;
    line-height: 1.5;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.options .option {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.options .option:hover {
    background: #edf2f7;
    border-color: #667eea;
}

.options .option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.options .option label {
    cursor: pointer;
    flex: 1;
    font-size: 16px;
}

.quiz-controls {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.quiz-controls button {
    min-width: 120px;
}

.results-summary {
    text-align: center;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.score-display {
    text-align: center;
}

.score-number {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 20px;
}

.score-emoji {
    font-size: 4em;
    margin-bottom: 15px;
}

.score-message {
    font-size: 1.2em;
    font-weight: 500;
    font-style: italic;
}

.results-details {
    margin: 30px 0;
}

.question-review-item {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid #cbd5e0;
}

.review-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.review-status {
    font-size: 1.5em;
    font-weight: bold;
}

.review-status.correct {
    color: #48bb78;
}

.review-status.incorrect {
    color: #e53e3e;
}

.review-answers {
    font-size: 14px;
    color: #4a5568;
}

.review-answers .user-answer {
    margin-bottom: 5px;
}

.review-answers .correct-answer {
    font-weight: bold;
    color: #22543d;
}

.explanation-text {
    margin-top: 10px;
    padding: 10px;
    background: #f0f8ff;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    font-style: italic;
    color: #2d3748;
}

/* Standardize image sizes */
.question-image, #question-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin: 15px 0;
    display: block;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Front page image */
.front-page-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Attribution */
.attribution {
    text-align: center;
    margin-top: 30px;
}

.attribution p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    font-style: italic;
}

.attribution a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.attribution a:hover {
    color: white;
    border-bottom-color: white;
}

/* Connection status indicator */
#connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #ff9500;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

#connection-status.online {
    background: #28a745;
}

#connection-status.syncing {
    background: #007bff;
}


@media (max-width: 768px) {
    .container {
        padding: 5px;
    }
    
    .section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    /* Make title smaller but still impressive on mobile */
    header h1 {
        font-size: 2.2em;
        margin-bottom: 10px;
        line-height: 1.1;
    }
    
    #start-quiz {
        font-size: 1.4em;
        padding: 15px 35px;
        margin: 20px auto;
    }
    
    header {
        margin-bottom: 10px;
    }
    
    .quiz-intro {
        margin: 15px 0;
    }
    
    .quiz-intro p {
        font-size: 1.1em;
        padding: 12px 20px;
    }
    
    .front-page-image {
        max-width: 300px;
        margin: 15px auto;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 5px;
    }
    
    /* Hide question counter on mobile */
    #question-counter {
        display: none;
    }
    
    .question-container {
        margin: 15px 0;
    }
    
    .quiz-controls {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .score-display {
        font-size: 1.8em;
    }
    
    .question-container h3 {
        font-size: 1.0em;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    #question-text {
        font-size: 0.95em;
        line-height: 1.3;
    }
    
    .options .option span {
        font-size: 0.95em;
    }
    
    .options {
        gap: 8px;
    }
    
    .options .option {
        padding: 10px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
  .question-image, #question-image {
    height: 150px !important;
  }

  button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .options {
    gap: 10px;
  }

  .options .option {
    padding: 12px;
  }
}
