/* Custom Styles for Quiz Platform - Tech Style */

:root {
    --primary-color: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary-color: #8B5CF6;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --gray-light: #F8FAFC;
    --gray-medium: #94A3B8;
    --gray-dark: #1E293B;
    --bg-gradient-start: #0F172A;
    --bg-gradient-end: #1E293B;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--gray-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.glass-dark {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Neon Glow Effects */
.neon-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;
}

.glow {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5),
                0 0 40px rgba(99, 102, 241, 0.3),
                0 0 60px rgba(99, 102, 241, 0.1);
}

/* Tech Grid Background */
.tech-grid {
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Navigation Styles */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* Section Transitions */
.content-section {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Modern Card Styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
    animation: shimmer 3s infinite;
}

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

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Modern Question Option Styles */
.option-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.95));
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.option-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    transition: width 0.5s, height 0.5s;
    transform: translate(-50%, -50%);
}

.option-card:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.98));
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.option-card:hover::before {
    width: 300%;
    height: 300%;
}

.option-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.98), rgba(191, 219, 254, 0.98));
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1),
                0 4px 20px rgba(99, 102, 241, 0.2);
    transform: scale(1.02);
}

.option-card.selected::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    animation: checkIn 0.3s ease;
}

@keyframes checkIn {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.option-card.correct {
    border-color: var(--success-color);
    background-color: #D1FAE5;
}

.option-card.incorrect {
    border-color: var(--danger-color);
    background-color: #FEE2E2;
}

.option-card .option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    text-align: center;
    font-weight: 600;
    margin-right: 1rem;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.option-card:hover .option-label {
    transform: rotate(5deg) scale(1.1);
}

.option-card.selected .option-label {
    background-color: var(--primary-color);
    color: white;
}

.option-card.correct .option-label {
    background-color: var(--success-color);
    color: white;
}

.option-card.incorrect .option-label {
    background-color: var(--danger-color);
    color: white;
}

/* Progress Bar Animation */
#progressBar {
    transition: width 0.5s ease;
}

/* Import Method Buttons */
.import-method-btn {
    transition: all 0.3s ease;
}

.import-method-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* File Drop Zone */
.drop-zone {
    border: 2px dashed #CBD5E1;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: #EFF6FF;
}

/* Toast Notification Animations */
#toast {
    animation: slideIn 0.3s ease-in-out;
}

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

#toast.hiding {
    animation: slideOut 0.3s ease-in-out;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

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

/* Modern Statistics Card Styles */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    padding: 1.75rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.4);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

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

/* Mistake Card Styles */
.mistake-card {
    background: white;
    border-left: 4px solid var(--danger-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.mistake-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

/* Modern Loading Spinner */
.spinner {
    width: 48px;
    height: 48px;
    position: relative;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner::after {
    animation-delay: 0.5s;
    border-top-color: var(--secondary-color);
}

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

/* Responsive Styles */
@media (max-width: 768px) {
    .nav-link {
        padding: 0.75rem 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
    background: #9CA3AF;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* Print Styles */
@media print {
    nav, 
    #toast,
    .no-print {
        display: none !important;
    }
    
    .content-section {
        page-break-inside: avoid;
    }
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Modern Focus Styles */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1),
                0 0 0 1px var(--primary-color);
}

/* Modern Input Styles */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
textarea:hover,
select:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

/* Modern Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Additional Tech Styles */
.option-text {
    font-size: 1rem;
    color: #334155;
    line-height: 1.6;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Animation for Important Elements */
@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.6),
                    0 0 50px rgba(99, 102, 241, 0.4);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Enhanced Input Fields */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1),
                0 4px 20px rgba(99, 102, 241, 0.15);
}

/* Enhanced Textarea for Questions */
#textAnswer {
    min-height: 120px;
    resize: vertical;
    font-size: 1rem;
    line-height: 1.6;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

#textAnswer:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1),
                0 4px 20px rgba(99, 102, 241, 0.15);
}

/* Loading Animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: loading-bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Success/Error Animations */
@keyframes success-check {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-animation {
    animation: success-check 0.5s ease;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .option-card {
        padding: 1rem;
    }
    
    .option-card .option-label {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    #questionTitle {
        font-size: 1.1rem;
    }
    
    .glass {
        padding: 1rem;
    }
}