/* Puraanamu Avagaahana Quiz Frontend Styles */

/* Import Telugu font */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@300;400;500;600;700&display=swap');

/* Base styles */
.snapgauge-quiz-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Noto Sans Telugu', Arial, sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.snapgauge-quiz-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    margin: 20px;
}

/* Quiz header */
.quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.quiz-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 400;
}

/* Quiz sections */
.quiz-section {
    padding: 30px;
    background: white;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Noto Sans Telugu', Arial, sans-serif;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.quiz-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: 'Noto Sans Telugu', Arial, sans-serif;
}

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

.quiz-btn.primary {
    background: #667eea;
    color: white;
}

.quiz-btn.primary:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.quiz-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.quiz-btn.secondary:hover:not(:disabled) {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.quiz-btn.success {
    background: #48bb78;
    color: white;
}

.quiz-btn.success:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

/* Progress bar */
.progress-bar {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

/* Question slides */
.question-slide {
    display: none;
    animation: slideIn 0.3s ease-in-out;
}

.question-slide.active {
    display: block;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

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

.question-number {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

.difficulty-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.difficulty-easy { 
    background: #48bb78; 
}

.difficulty-medium { 
    background: #ed8936; 
}

.difficulty-hard { 
    background: #f56565; 
}

.question-content h3 {
    font-size: 20px;
    margin-bottom: 25px;
    line-height: 1.6;
    color: #2d3748;
    font-weight: 500;
}

/* Options */
.options {
    margin-bottom: 30px;
}

.option-label {
    display: block;
    margin-bottom: 15px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: white;
}

.option-label:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateX(3px);
}

.option-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-label input[type="radio"]:checked + .option-text {
    color: #667eea;
    font-weight: 600;
}

.option-label:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #edf2f7;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.option-text {
    font-size: 16px;
    line-height: 1.5;
    display: block;
}

/* Question navigation */
.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

/* Results section */
.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h3 {
    font-size: 28px;
    color: #2d3748;
    margin: 0;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.score-details p {
    margin: 8px 0;
    font-size: 16px;
}

.score-details strong {
    color: #2d3748;
}

.performance-message {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.performance-message.excellent {
    background: #c6f6d5;
    color: #22543d;
    border: 2px solid #9ae6b4;
}

.performance-message.good {
    background: #fef5e7;
    color: #744210;
    border: 2px solid #f6e05e;
}

.performance-message.average {
    background: #fed7d7;
    color: #742a2a;
    border: 2px solid #fc8181;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Feedback section */
.feedback-content {
    max-width: 500px;
    margin: 0 auto;
}

.rating-stars {
    display: flex;
    gap: 5px;
    margin: 10px 0;
    justify-content: center;
}

.star {
    font-size: 28px;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.3s ease;
    user-select: none;
}

.star:hover,
.star.active,
.star.hover {
    opacity: 1;
    transform: scale(1.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 12px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.loading-overlay p {
    font-size: 16px;
    color: #4a5568;
    margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .snapgauge-quiz-wrapper {
        margin: 10px;
        border-radius: 8px;
    }
    
    .quiz-section {
        padding: 20px;
    }
    
    .quiz-header {
        padding: 15px;
    }
    
    .quiz-header h2 {
        font-size: 20px;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
    }
    
    .score-display {
        flex-direction: column;
        gap: 20px;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
        font-size: 20px;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .question-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .question-navigation .quiz-btn {
        width: 100%;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .quiz-btn {
        width: 100%;
    }
    
    .option-label {
        padding: 12px;
    }
    
    .option-text {
        font-size: 15px;
    }
    
    .question-content h3 {
        font-size: 18px;
    }
    
    .performance-message {
        font-size: 16px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .quiz-section {
        padding: 15px;
    }
    
    .quiz-header {
        padding: 12px;
    }
    
    .quiz-header h2 {
        font-size: 18px;
    }
    
    .question-content h3 {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .option-label {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .quiz-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .score-circle {
        width: 80px;
        height: 80px;
        font-size: 18px;
    }
    
    .performance-message {
        font-size: 14px;
        padding: 12px;
    }
    
    .rating-stars .star {
        font-size: 24px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .quiz-btn.primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .quiz-btn.secondary {
        background: #fff;
        border: 2px solid #000;
        color: #000;
    }
    
    .option-label {
        border-width: 3px;
    }
    
    .option-label:hover {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .question-slide,
    .quiz-btn,
    .option-label,
    .star,
    .progress-fill {
        transition: none;
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
        border: 4px solid #667eea;
    }
}

/* Print styles */
@media print {
    .snapgauge-quiz-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .quiz-header {
        background: #000 !important;
        color: #fff !important;
    }
    
    .quiz-btn {
        border: 1px solid #000;
        background: #fff !important;
        color: #000 !important;
    }
}
