/* ===================================
   DPDPA Quiz Styles
   www.dpdpa.com
   =================================== */

/* CSS Variables for Theme */
:root {
    --primary-color: #2C3E50;
    --secondary-color: #3498DB;
    --success-color: #27AE60;
    --warning-color: #F39C12;
    --danger-color: #E74C3C;
    --light-bg: #ECF0F1;
    --white: #FFFFFF;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --border-color: #BDC3C7;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    min-height: 100vh;
    /* Removed display: flex, justify-content, align-items to prevent vertical centering */
    padding: 20px;
    padding-top: 180px; /* Added to account for fixed header + nav (80px + 50px + buffer) */
    line-height: 1.6;
    color: var(--text-dark);
}

/* Container */
.container {
    max-width: 900px;
    width: 100%;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    margin: 0 auto; /* This correctly centers horizontally */
    margin-top: 20px; /* Small gap from top after body padding */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.quiz-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
}

.logo-section h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
}

.powered-by {
    margin-top: 15px;
    font-size: 0.9em;
}

.powered-by a {
    color: var(--white);
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s;
}

.powered-by a:hover {
    border-bottom-color: var(--white);
}

/* Screen Management */
.screen {
    display: none;
    padding: 40px;
    min-height: 500px;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Welcome Screen */
.welcome-content {
    
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.quiz-icon {
    font-size: 5em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.welcome-content h2 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.welcome-description {
    font-size: 1.1em;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.8;
}

/* Quiz Info Grid */
.quiz-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.info-item {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.info-icon {
    font-size: 2em;
}

/* Difficulty Selector */
.difficulty-selector {
    margin: 40px 0;
}

.difficulty-selector h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3em;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.difficulty-btn {
    background: var(--white);
    border: 2px solid var(--border-color);
    padding: 20px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.difficulty-btn:hover {
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.difficulty-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
}

.diff-icon {
    font-size: 2em;
}

.diff-label {
    font-weight: 600;
    font-size: 1.1em;
}

.diff-desc {
    font-size: 0.85em;
    opacity: 0.8;
}

/* Buttons */
.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #2980B9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #D5DBDB;
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #229954;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quiz Progress */
.quiz-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--light-bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: var(--text-light);
    font-weight: 600;
}

/* Question Container */
.question-container {
    margin-bottom: 30px;
}

.question-card {
    background: var(--white);
    border: 2px solid var(--light-bg);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
}

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

.question-number {
    background: var(--secondary-color);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.question-difficulty {
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

.difficulty-basic {
    background: #D5F4E6;
    color: #27AE60;
}

.difficulty-intermediate {
    background: #FCF3CF;
    color: #F39C12;
}

.difficulty-advanced {
    background: #FADBD8;
    color: #E74C3C;
}

.question-text {
    font-size: 1.3em;
    color: var(--primary-color);
    margin-bottom: 25px;
    line-height: 1.6;
    font-weight: 500;
}

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

.option {
    background: var(--light-bg);
    border: 2px solid transparent;
    padding: 18px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option:hover {
    background: #D5DBDB;
    transform: translateX(5px);
}

.option.selected {
    background: #D6EAF8;
    border-color: var(--secondary-color);
}

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

.option.incorrect {
    background: #FADBD8;
    border-color: var(--danger-color);
}

.option-label {
    background: var(--white);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
}

.option.selected .option-label {
    background: var(--secondary-color);
    color: var(--white);
}

.option.correct .option-label {
    background: var(--success-color);
    color: var(--white);
}

.option.incorrect .option-label {
    background: var(--danger-color);
    color: var(--white);
}

.option-text {
    flex: 1;
    font-size: 1.05em;
}

/* Navigation */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

/* Results Screen */
.results-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.result-icon {
    font-size: 6em;
    margin-bottom: 20px;
    animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.results-content h2 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 30px;
}

/* Score Display */
.score-display {
    margin: 30px 0;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--success-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 170px;
    height: 170px;
    background: var(--white);
    border-radius: 50%;
}

.score-number {
    font-size: 4em;
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
    z-index: 1;
}

.score-label {
    font-size: 2em;
    color: var(--text-light);
    position: relative;
    z-index: 1;
}

.score-text {
    font-size: 1.3em;
    color: var(--text-dark);
}

/* Performance Message */
.performance-message {
    background: var(--light-bg);
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    font-size: 1.2em;
    line-height: 1.8;
}

/* Category Breakdown */
.results-breakdown {
    margin: 40px 0;
    text-align: left;
}

.results-breakdown h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
}

.category-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.category-item {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.category-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.category-score {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Answers Review */
.answers-review {
    margin: 40px 0;
    text-align: left;
}

.review-question {
    background: var(--light-bg);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

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

.review-status {
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 15px;
}

.review-status.correct {
    background: #D5F4E6;
    color: var(--success-color);
}

.review-status.incorrect {
    background: #FADBD8;
    color: var(--danger-color);
}

.review-question-text {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.review-answers {
    margin-bottom: 15px;
}

.review-answer {
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 8px;
}

.your-answer {
    background: #FADBD8;
    font-weight: 600;
}

.correct-answer {
    background: #D5F4E6;
    font-weight: 600;
}

.explanation {
    background: var(--white);
    padding: 15px;
    border-left: 4px solid var(--secondary-color);
    border-radius: 5px;
    font-style: italic;
    color: var(--text-dark);
    margin-top: 15px;
}

/* Result Actions */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}

/* Expert Contact */
.expert-contact {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 30px;
    border-radius: 12px;
    margin-top: 40px;
}

.expert-contact p {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.contact-link {
    display: inline-block;
    background: var(--white);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.contact-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Footer */
.quiz-footer {
    background: var(--light-bg);
    padding: 25px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9em;
}

.quiz-footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.quiz-footer a:hover {
    text-decoration: underline;
}

.disclaimer {
    margin-top: 10px;
    font-size: 0.85em;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    .quiz-header {
        padding: 20px;
    }
    
    .logo-section h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.95em;
    }
    
    .screen {
        padding: 25px;
    }
    
    .quiz-info {
        grid-template-columns: 1fr;
    }
    
    .difficulty-buttons {
        grid-template-columns: 1fr;
    }
    
    .quiz-navigation {
        flex-direction: column;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-circle::before {
        width: 120px;
        height: 120px;
    }
    
    .score-number {
        font-size: 3em;
    }
    
    .category-breakdown {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .logo-section h1 {
        font-size: 1.5em;
    }
    
    .question-text {
        font-size: 1.1em;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .quiz-navigation,
    .result-actions,
    .btn {
        display: none;
    }
}
