/* filepath: c:\Users\salman.sabir\0 Active\Test_app\knowledge-test-app\src\refact\test\style.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    padding: 20px;
    background: linear-gradient(135deg, #87ceeb 0%, #b0e0e6 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.quiz-container {
    max-width: 700px;
    margin: auto;
    padding: 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.explanation-box {
  margin-top: 15px;
  padding: 15px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-left: 5px solid #2196f3;
  display: none;            /* hidden until needed */
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 400;
  color: #1565c0;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-title {
    text-align: center;
    font-size: 1.8rem;
    color: #4c63d2;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(76, 99, 210, 0.3);
    letter-spacing: 0.5px;
}

h1, h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

h2 {
    font-size: 1.5rem;
    color: #4c63d2;
}

#question {
	white-space: pre-line; 
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: #2c3e50;
    font-weight: 500;
    line-height: 1.7;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%);
    border-radius: 15px;
    border: 1px solid #e1e8ff;
}

#question-image img {
    max-height: 270px;
    width: 90%;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 3px solid #f0f4ff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#question-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

#options button {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    border: 2px solid #e1e8ff;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #2c3e50;
    position: relative;
    overflow: hidden;
}

/* Commented out: Purple gradient hover effect */
/*
#options button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: left 0.3s ease;
    z-index: -1;
}
*/

#options button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    /* color: #fff; */  /* Commented out: White text color on hover */
}

/* Commented out: Purple gradient slide-in trigger */
/*
#options button:hover::before {
    left: 0;
}
*/

#options button:active {
    transform: translateY(0);
}

#next-btn, #restart-btn, #pay-btn {
    margin-top: 25px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 150px;
}

#next-btn {
    display: none;
}

#next-btn:hover, #restart-btn:hover, #pay-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

#next-btn:active, #restart-btn:active, #pay-btn:active {
    transform: translateY(-1px);
}

#feedback {
    font-weight: 600;
    margin-top: 15px;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#feedback.correct {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    color: #2e7d32;
    border: 2px solid #4caf50;
}

#feedback.incorrect {
    background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%);
    color: #c62828;
    border: 2px solid #f44336;
}

#feedback.timeout {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
    color: #ef6c00;
    border: 2px solid #ff9800;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

#timer {
    text-align: right;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1rem;
    padding: 10px 15px;
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border-radius: 12px;
    border: 2px solid #ffc107;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#timer.warning {
    background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%);
    border-color: #f44336;
    color: #c62828;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#progress-container {
    width: 100%;
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    border-radius: 25px;
    height: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #b39ddb;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 25px;
    position: relative;
    overflow: hidden;
}

#progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(45deg, rgba(255,255,255,.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.2) 50%, rgba(255,255,255,.2) 75%, transparent 75%, transparent);
    background-size: 50px 50px;
    animation: progress-animation 2s linear infinite;
}

@keyframes progress-animation {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

#payment-screen {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 20px;
    border: 2px solid #ffcc02;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
}

#payment-screen h2 {
    color: #ef6c00;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

#payment-screen p {
    font-size: 1.2rem;
    color: #bf360c;
    margin-bottom: 25px;
    line-height: 1.6;
}

#payment-screen button {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#payment-screen button:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 152, 0, 0.5);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .quiz-container {
        padding: 20px;
        border-radius: 15px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    
    .app-title {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }
    
    #question {
        font-size: 1.1rem;
        padding: 15px;
        margin-bottom: 20px;
    }
    
    #options button {
        padding: 12px 15px;
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    #next-btn, #restart-btn, #pay-btn {
        padding: 12px 25px;
        font-size: 1rem;
        min-width: 120px;
    }
    
    #question-image img {
        max-height: 180px;
    }
    
    #timer {
        font-size: 1rem;
        padding: 8px 12px;
    }
    
    #payment-screen {
        padding: 20px;
    }
    
    #payment-screen h2 {
        font-size: 1.5rem;
    }
    
    #payment-screen p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        padding: 15px;
        margin: 5px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    .app-title {
        font-size: 1.2rem;
    }
    
    #question {
        font-size: 1rem;
        padding: 12px;
    }
    
    #options button {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    #next-btn, #restart-btn, #pay-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
        min-width: 100px;
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    body {
        background: #000;
        color: #fff;
    }
    
    .quiz-container {
        background: #fff;
        color: #000;
        border: 3px solid #000;
    }
    
    #options button {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
    
    #options button:hover {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus, select:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Score styling */
#score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4c63d2;
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-radius: 15px;
    border: 2px solid #4caf50;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.2);
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced focus indicators */
*:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #667eea;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Copyright Footer */
.copyright-footer {
    position: fixed;
    bottom: 10px;
    right: 15px;
    font-size: 0.75rem;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-weight: 400;
    letter-spacing: 0.3px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .copyright-footer {
        font-size: 0.65rem;
        padding: 3px 8px;
        bottom: 8px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .copyright-footer {
        font-size: 0.6rem;
        padding: 2px 6px;
        bottom: 5px;
        right: 8px;
    }
}