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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 25%, #06b6d4 50%, #10b981 75%, #059669 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
    background-size: 400% 400%;
    animation: gradientShift 8s ease forwards;
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Container and Layout */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Header Styles */
.quiz-header {
    text-align: center;
    margin-bottom: 3rem;
}

.header-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.quiz-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.quiz-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 2rem;
    font-weight: 500;
    line-height: 1.5;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(30, 58, 138, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6, #06b6d4, #10b981);
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 8.33%; /* 1/12 for first question */
    position: relative;
    animation: progressGlow 2s ease-in-out infinite alternate;
}

@keyframes progressGlow {
    0% { 
        box-shadow: 0 0 5px rgba(30, 58, 138, 0.3);
    }
    100% { 
        box-shadow: 0 0 15px rgba(30, 58, 138, 0.6), 0 0 25px rgba(59, 130, 246, 0.3);
    }
}

.progress-text {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

/* Main Quiz Content */
.quiz-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.quiz-content {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.6s ease;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

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

/* Question Group Styles */
.question-group-container {
    text-align: center;
}

.group-header {
    margin-bottom: 2rem;
}

.group-number {
    display: inline-block;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.group-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.group-instruction {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 2rem;
    font-weight: 500;
}

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

.item-window {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.item-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 138, 0.1), transparent);
    transition: left 0.5s ease;
}

.item-window:hover::before {
    left: 100%;
}

.item-window:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    border-color: rgba(30, 58, 138, 0.3);
}

.item-window.selected {
    border-color: #1e3a8a;
    background: rgba(30, 58, 138, 0.1);
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.2);
}

.item-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.checkbox-inner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: transparent;
    transition: all 0.3s ease;
    background: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkbox-inner.checked {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: white;
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.3);
}

.item-text {
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.5;
    text-align: center;
}

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

.answer-option {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.answer-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.answer-option:hover::before {
    left: 100%;
}

.answer-option:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.answer-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.answer-option input[type="radio"] {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.answer-option label {
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    flex: 1;
}

/* Navigation Styles */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-button:hover::before {
    left: 100%;
}

.nav-button.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.nav-button.secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.nav-button.secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    transform: translateY(-2px);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.nav-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Results Section */
.results-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-container {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.6s ease;
    margin: 0 auto;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.results-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 2rem;
    font-weight: 500;
    line-height: 1.5;
}

.results-content {
    margin-bottom: 2rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-button.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.action-button.secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.action-button.secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    color: #2d3748;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem 0.5rem;
    }
    
    .header-content,
    .quiz-content,
    .results-container {
        padding: 1.5rem;
        margin: 0 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .quiz-title {
        font-size: 2.2rem;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .nav-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-button {
        width: 100%;
        max-width: 300px;
    }
    
    .progress-bar {
        height: 10px;
    }
}

@media (max-width: 480px) {
    .quiz-title {
        font-size: 1.8rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .answer-option {
        padding: 1rem;
    }
    
    .nav-button {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .header-content,
    .quiz-content,
    .results-container {
        padding: 1rem;
        margin: 0 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .progress-bar {
        height: 8px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.answer-option:focus-within,
.nav-button:focus,
.action-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .quiz-container {
        max-width: none;
        padding: 0;
    }
    
    .header-content,
    .quiz-content,
    .results-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
