/* Metallurgy Heat Treatment Quiz - Stunning Visual Design */

:root {
    /* Metallurgy Color Palette */
    --steel-gray: #2C3E50;
    --fire-orange: #E67E22;
    --quench-blue: #3498DB;
    --austenite-red: #E74C3C;
    --martensite-silver: #95A5A6;
    --temper-gold: #F39C12;
    --success-green: #27AE60;
    --danger-red: #C0392B;
    --bg-dark: #1A1A2E;
    --bg-light: #F8F9FA;
    --text-light: #ECF0F1;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(230, 126, 34, 0.5);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--steel-gray) 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--fire-orange);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
    opacity: 0.3;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-100px) translateX(50px); }
    50% { transform: translateY(-50px) translateX(-50px); }
    75% { transform: translateY(-150px) translateX(100px); }
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--steel-gray), var(--fire-orange));
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '🔥';
    position: absolute;
    font-size: 10rem;
    opacity: 0.1;
    top: -2rem;
    right: 5%;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.1); opacity: 0.2; }
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: slideInDown 0.8s ease;
}

.header .subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.header .tags {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Stats Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeIn 1s ease;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--fire-orange);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--fire-orange);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* Quiz Introduction */
.quiz-intro {
    background: linear-gradient(135deg, var(--quench-blue), var(--austenite-red));
    padding: 3rem;
    border-radius: 20px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    animation: slideInUp 0.8s ease;
}

.quiz-intro h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.quiz-intro ul {
    list-style: none;
    margin-top: 1.5rem;
}

.quiz-intro li {
    padding: 0.8rem 0;
    padding-left: 2rem;
    position: relative;
    font-size: 1.1rem;
}

.quiz-intro li::before {
    content: '⚡';
    position: absolute;
    left: 0;
    font-size: 1.3rem;
}

/* Start Button */
.start-btn {
    background: linear-gradient(135deg, var(--fire-orange), var(--austenite-red));
    color: white;
    padding: 1.5rem 4rem;
    font-size: 1.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: 2rem;
}

.start-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(230, 126, 34, 0.5);
}

.start-btn:active {
    transform: translateY(-2px);
}

/* Quiz Container */
.quiz-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 2rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.progress-bar {
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--fire-orange), var(--austenite-red));
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.8);
}

/* Question Card */
.question-card {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(231, 76, 60, 0.2));
    padding: 2.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 2px solid var(--quench-blue);
    animation: questionSlide 0.5s ease;
}

@keyframes questionSlide {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.question-number {
    display: inline-block;
    background: var(--fire-orange);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.question-text {
    font-size: 1.4rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.scenario {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-left: 5px solid var(--temper-gold);
    margin: 1.5rem 0;
    border-radius: 10px;
    font-style: italic;
}

/* Options */
.options {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.option {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

.option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
    border-color: var(--quench-blue);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.3);
}

.option-label {
    width: 40px;
    height: 40px;
    background: var(--steel-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.option.selected {
    background: rgba(52, 152, 219, 0.3);
    border-color: var(--quench-blue);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.option.correct {
    background: rgba(39, 174, 96, 0.3);
    border-color: var(--success-green);
    animation: correctPulse 0.5s ease;
}

.option.incorrect {
    background: rgba(192, 57, 43, 0.3);
    border-color: var(--danger-red);
    animation: shake 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Explanation Panel */
.explanation-panel {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2), rgba(241, 196, 15, 0.2));
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    border-left: 5px solid var(--success-green);
    animation: slideInUp 0.5s ease;
}

.explanation-panel.wrong {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.2), rgba(241, 196, 15, 0.2));
    border-left-color: var(--danger-red);
}

.explanation-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explanation-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.tip-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    border-left: 4px solid var(--temper-gold);
}

.tip-title {
    color: var(--temper-gold);
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.keywords {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.keyword {
    background: var(--fire-orange);
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--quench-blue), var(--steel-gray));
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-green), var(--quench-blue));
    color: white;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.5);
}

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

/* Results Screen */
.results-container {
    text-align: center;
    animation: fadeIn 1s ease;
}

.score-display {
    font-size: 6rem;
    font-weight: bold;
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--fire-orange), var(--austenite-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: scoreReveal 1s ease;
}

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

.performance-message {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.performance-icon {
    font-size: 8rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

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

.results-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.result-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.result-stat-value {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Quick Revision */
.revision-section {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(52, 152, 219, 0.2));
    padding: 3rem;
    border-radius: 20px;
    margin: 3rem 0;
    border: 2px solid var(--quench-blue);
}

.revision-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.revision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.revision-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 5px solid var(--fire-orange);
    transition: all 0.3s ease;
}

.revision-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.revision-card h3 {
    color: var(--temper-gold);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.revision-card ul {
    list-style: none;
}

.revision-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.revision-card li::before {
    content: '🔹';
    position: absolute;
    left: 0;
}

/* Animations */
@keyframes slideInDown {
    from { transform: translateY(-100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 { font-size: 2rem; }
    .header .subtitle { font-size: 1rem; }
    .quiz-container { padding: 1.5rem; }
    .question-text { font-size: 1.2rem; }
    .option { font-size: 1rem; }
    .score-display { font-size: 4rem; }
    .performance-icon { font-size: 5rem; }
    .nav-buttons { flex-direction: column; }
    .btn { width: 100%; }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--fire-orange);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hidden Class */
.hidden {
    display: none !important;
}
