/* Custom styles for Marketing Analytics Learning Platform */

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-pulse-slow {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-slideInRight {
    animation: slideInRight 0.5s ease-out;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Worksheet Card Enhancements */
.worksheet-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.worksheet-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #8b5cf6;
}

.worksheet-card.locked {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    opacity: 0.7;
}

.worksheet-card.completed {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border-color: #10b981;
}

/* Progress Ring Animation */
.progress-ring {
    transition: stroke-dashoffset 0.5s ease-in-out;
}

/* Badge Styles */
.badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge.excellence {
    background: linear-gradient(135deg, #06d6a0 0%, #10b981 100%);
}

.badge.proficient {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.badge.competent {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
    word-wrap: break-word;
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

.notification.warning {
    background: #f59e0b;
    color: white;
}

.notification.info {
    background: #3b82f6;
    color: white;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

/* Leaderboard Enhancements */
.leaderboard-rank {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

.leaderboard-rank.rank-1 {
    color: #f59e0b;
}

.leaderboard-rank.rank-2 {
    color: #6b7280;
}

.leaderboard-rank.rank-3 {
    color: #d97706;
}

/* Chart Container Enhancements */
.chart-container {
    position: relative;
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Modal Enhancements */
.modal-overlay {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    animation: fadeInUp 0.3s ease-out;
}

/* Form Enhancements */
.form-input {
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
}

.form-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

.form-input:invalid {
    border-color: #ef4444;
}

/* Button Enhancements */
.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

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

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Timer Display */
.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
    background: #f9fafb;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 2px solid #e5e7eb;
}

.timer-warning {
    color: #f59e0b;
    border-color: #f59e0b;
    animation: pulse 1s infinite;
}

.timer-danger {
    color: #ef4444;
    border-color: #ef4444;
    animation: pulse 0.5s infinite;
}

/* Question Styles */
.question-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.question-card:hover {
    border-color: #8b5cf6;
    background: #faf5ff;
}

.question-number {
    background: #8b5cf6;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    margin-right: 0.75rem;
}

/* Radio Button Styling */
.custom-radio {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-radio:checked {
    border-color: #8b5cf6;
    background: #8b5cf6;
}

.custom-radio:checked::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .flex-row {
        flex-direction: column;
    }
    
    .space-x-4 > * + * {
        margin-left: 0;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .text-2xl {
        font-size: 1.5rem;
    }
    
    .text-lg {
        font-size: 1.125rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
    
    .px-6 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .worksheet-card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
    
    .badge {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }
}

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

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

button:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}