/* AI Master Education Platform - Custom Styles */

/* Import Tailwind CSS from CDN (fallback for when Vite is not available) */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@3.4.0/dist/tailwind.min.css');

/* Custom CSS Variables */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6366f1;
    --accent-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
}

/* Custom Utility Classes */
.btn-primary {
    @apply bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200;
}

.btn-secondary {
    @apply bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-2 px-4 rounded-md transition-colors duration-200;
}

.btn-outline {
    @apply border border-indigo-600 text-indigo-600 hover:bg-indigo-600 hover:text-white font-medium py-2 px-4 rounded-md transition-colors duration-200;
}

.card {
    @apply bg-white rounded-lg shadow-sm border border-gray-200 p-6;
}

.card-hover {
    @apply bg-white rounded-lg shadow-sm border border-gray-200 p-6 hover:shadow-md hover:border-indigo-300 transition-all duration-200;
}

.input-field {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500;
}

.select-field {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 bg-white;
}

/* Custom Components */
.academic-level-card {
    @apply bg-white overflow-hidden shadow rounded-lg hover:shadow-lg transition-shadow duration-200;
}

.academic-level-card:hover {
    @apply transform scale-105 transition-transform duration-200;
}

.feature-card {
    @apply text-center p-6 bg-white rounded-lg shadow-sm hover:shadow-md transition-shadow duration-200;
}

.hero-section {
    @apply relative bg-gradient-to-br from-indigo-50 to-purple-50 overflow-hidden;
}

.hero-section::before {
    content: '';
    @apply absolute inset-0 bg-gradient-to-r from-indigo-600/10 to-purple-600/10;
}

/* Language Switcher Styles */
.language-switcher {
    @apply flex items-center space-x-2;
}

.language-btn {
    @apply px-2 py-1 text-sm rounded transition-colors duration-200;
}

.language-btn.active {
    @apply bg-indigo-100 text-indigo-700 font-medium;
}

.language-btn:not(.active) {
    @apply text-gray-500 hover:text-gray-700 hover:bg-gray-100;
}

/* Dashboard Styles */
.dashboard-card {
    @apply bg-white overflow-hidden shadow-sm sm:rounded-lg;
}

.dashboard-stat {
    @apply p-4 rounded-lg;
}

.dashboard-stat.academic {
    @apply bg-indigo-50;
}

/* Enhanced Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(102, 126, 234, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Enhanced Form Animations */
.form-field-enter {
    animation: formFieldEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.form-field-enter:nth-child(1) { animation-delay: 0.1s; }
.form-field-enter:nth-child(2) { animation-delay: 0.2s; }
.form-field-enter:nth-child(3) { animation-delay: 0.3s; }
.form-field-enter:nth-child(4) { animation-delay: 0.4s; }

/* Enhanced Button States */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-enhanced::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-enhanced:hover::before {
    left: 100%;
}

/* Enhanced Input Focus Effects */
.input-enhanced {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.input-enhanced:focus {
    transform: scale(1.02);
}

.input-enhanced:focus::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    animation: inputFocusLine 0.3s ease-out;
}

@keyframes inputFocusLine {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Enhanced Loading States */
.loading-enhanced {
    position: relative;
    overflow: hidden;
}

.loading-enhanced::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced Hover Effects */
.hover-glow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* Enhanced Accessibility */
.focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Enhanced Responsive Design */
@media (max-width: 640px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-form {
        padding: 1.5rem;
    }
    
    .login-header h2 {
        font-size: 1.875rem;
    }
}

@media (max-width: 480px) {
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .login-form {
        padding: 1rem;
    }
}

/* Enhanced Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .login-page {
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    }
}

/* Enhanced Print Styles */
@media print {
    .login-page {
        background: white;
        color: black;
    }
    
    .glass-effect,
    .glass-effect-strong {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

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

/* Enhanced High Contrast Mode */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }
    
    .btn-primary {
        border: 2px solid white;
    }
}

/* Enhanced Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .floating,
    .floating-delayed {
        animation: none;
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
}

/* ===== HOMEPAGE ENHANCEMENTS ===== */

/* Modern Flat Design Elements */
.flat-card {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Enhanced Hero Section */
.hero-section-enhanced {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero-section-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

/* Modern Button Styles */
.btn-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

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

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* Enhanced Feature Cards */
.feature-card-enhanced {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f3f4f6;
    position: relative;
    overflow: hidden;
}

.feature-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card-enhanced:hover::before {
    transform: scaleX(1);
}

.feature-card-enhanced:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Modern Navigation */
.nav-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.nav-modern.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Enhanced Typography */
.heading-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.025em;
}

/* Modern Form Elements */
.input-modern {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    font-size: 16px;
}

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

/* Enhanced Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

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

.stagger-animation > * {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }

/* Modern Grid Layout */
.grid-modern {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .grid-modern {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-card-enhanced {
        padding: 24px 16px;
    }
    
    .btn-modern {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Modern Color Palette */
:root {
    --modern-primary: #667eea;
    --modern-secondary: #764ba2;
    --modern-accent: #f093fb;
    --modern-success: #10b981;
    --modern-warning: #f59e0b;
    --modern-error: #ef4444;
    --modern-gray-50: #f9fafb;
    --modern-gray-100: #f3f4f6;
    --modern-gray-200: #e5e7eb;
    --modern-gray-300: #d1d5db;
    --modern-gray-400: #9ca3af;
    --modern-gray-500: #6b7280;
    --modern-gray-600: #4b5563;
    --modern-gray-700: #374151;
    --modern-gray-800: #1f2937;
    --modern-gray-900: #111827;
}

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

/* Focus Management */
.focus-ring:focus {
    outline: 2px solid var(--modern-primary);
    outline-offset: 2px;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .btn-modern {
        border: 2px solid currentColor;
    }
    
    .feature-card-enhanced {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .fade-in-up,
    .stagger-animation > * {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .btn-modern:hover,
    .feature-card-enhanced:hover {
        transform: none;
    }
}
