/**
 * Custom CSS for VAK Assessment Application
 * Enhances Tailwind CSS with specific styling for the application
 */

/* Custom Font Loading */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Root Variables */
:root {
    --primary-purple: #667eea;
    --secondary-indigo: #764ba2;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --bg-light: #f9fafb;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    scroll-behavior: smooth;
}

/* Utility Classes */
.gradient-bg {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-indigo) 100%);
}

.card-shadow {
    box-shadow: var(--shadow-large);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animation Classes */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

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

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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

/* VAK Card Styles */
.vak-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
}

.vak-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Progress Bar Styles */
.quiz-progress {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--primary-purple), var(--secondary-indigo));
}

/* Answer Option Styles */
.answer-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    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;
}

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

.answer-option:hover {
    background-color: #f8faff;
    border-color: var(--primary-purple);
    transform: translateX(6px);
    box-shadow: var(--shadow-medium);
}

.answer-option.selected {
    background: linear-gradient(135deg, var(--primary-purple), var(--secondary-indigo));
    color: white;
    border-color: var(--primary-purple);
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.answer-option.selected:hover {
    transform: translateX(6px) scale(1.02);
}

/* Button Enhancements */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple), var(--secondary-indigo));
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Score Bar Animations */
.score-item {
    opacity: 0;
    animation: scoreItemFadeIn 0.6s ease-out forwards;
}

.score-item:nth-child(1) { animation-delay: 0.2s; }
.score-item:nth-child(2) { animation-delay: 0.4s; }
.score-item:nth-child(3) { animation-delay: 0.6s; }

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

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Loading Spinner Enhancement */
.loading-spinner {
    border: 3px solid rgba(102, 126, 234, 0.1);
    border-top: 3px solid var(--primary-purple);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-large);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.toast.show {
    transform: translateX(0);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .vak-card {
        margin-bottom: 1rem;
    }
    
    .answer-option {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .answer-option:hover {
        transform: translateX(2px);
    }
    
    .answer-option.selected {
        transform: translateX(2px);
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .card-shadow {
        box-shadow: var(--shadow-medium);
    }
    
    .answer-option {
        font-size: 0.9rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

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

/* Focus States */
.answer-option:focus,
button:focus,
.btn-primary:focus {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .vak-card {
        border: 2px solid currentColor;
    }
    
    .answer-option {
        border: 2px solid currentColor;
    }
    
    .answer-option.selected {
        background: currentColor;
        color: white;
    }
}

/* Print Styles */
@media print {
    .gradient-bg {
        background: white !important;
        color: black !important;
    }
    
    .card-shadow {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .answer-option {
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
    
    .vak-card {
        break-inside: avoid;
        border: 1px solid #ccc !important;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-indigo);
}

/* Selection Color */
::selection {
    background-color: var(--primary-purple);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-purple);
    color: white;
}