/* Custom styles for Dart Programming Quiz */

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Question text styling */
#question-text {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #1f2937;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border-left: 6px solid #3b82f6;
    min-height: 80px;
    display: flex;
    align-items: center;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

#question-text::before {
    content: "📝";
    position: absolute;
    top: -10px;
    left: 20px;
    background: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fallback for empty question text */
#question-text:empty::before {
    content: "Loading question...";
    color: #9ca3af;
    font-style: italic;
}

/* Question loaded state */
#question-text.question-loaded {
    animation: fadeIn 0.3s ease-in;
    border-left-color: #10b981;
}

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

/* Quiz animations */
.quiz-screen {
    animation: slideIn 0.5s ease-out;
}

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

/* Question container animation */
.bg-white.rounded-lg.shadow-lg.p-8 {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Question navigation buttons */
.question-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.question-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.question-nav-btn.answered {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.question-nav-btn.current {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: scale(1.1);
}

.question-nav-btn.unanswered {
    background-color: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

/* Option styling */
.option-item {
    padding: 18px 22px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: white;
    font-size: 1.1rem;
    font-weight: 500;
}

.option-item:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
    transform: translateX(4px);
}

.option-item.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
    color: #1e40af;
}

.option-item.correct {
    border-color: #10b981;
    background-color: #ecfdf5;
    color: #065f46;
}

.option-item.incorrect {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #991b1b;
}

/* Timer animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.timer-warning {
    animation: pulse 1s infinite;
    color: #ef4444 !important;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.5s ease-in-out;
}

/* Button hover effects */
.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Card hover effects */
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Quiz level cards */
.quiz-level-card {
    transition: all 0.3s ease;
}

.quiz-level-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* AdSense container styling */
.adsbygoogle {
    min-height: 90px;
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .question-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .grid-cols-10 {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .quiz-level-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .grid-cols-10 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .option-item {
        padding: 12px 16px;
    }
    
    .quiz-level-card {
        padding: 1.5rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4bb71b;
    stroke-miterlimit: 10;
    margin: 10% auto;
    box-shadow: inset 0px 0px 0px #4bb71b;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
    position: relative;
}

.success-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4bb71b;
    fill: #fff;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #4bb71b;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-white {
        background: white !important;
        border: 1px solid #ccc !important;
    }
}

/* Quiz selection screen animations */
.quiz-selection {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Quiz level card specific styles */
.quiz-level-card.basic {
    border-left: 4px solid #10b981;
}

.quiz-level-card.intermediate {
    border-left: 4px solid #f59e0b;
}

.quiz-level-card.advanced {
    border-left: 4px solid #ef4444;
}

/* Certification section styling */
.certification-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.certification-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.certification-section p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.certification-section .btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.certification-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: #667eea;
}

/* Results screen improvements */
.results-summary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.results-summary h2 {
    color: white;
    text-align: center;
    margin-bottom: 1rem;
}

/* AdSense responsive improvements */
@media (max-width: 768px) {
    .adsbygoogle {
        min-height: 60px;
    }
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #ffffff !important;
    }
    
    .text-gray-600 {
        color: #000000 !important;
    }
    
    .border-gray-200 {
        border-color: #000000 !important;
    }
}
