/* MapleStory Classic Enhanced Theme Styles */

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

::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #F5D800, #f59e0b);
    border-radius: 6px;
    border: 2px solid #1a1a2e;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #fbbf24, #f59e0b);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes glow {
    0%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor;
    }
    50% {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor,
            0 0 40px currentColor;
    }
}

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

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

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

/* Floating particles and leaves */
.floating-leaves {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.floating-leaves::before,
.floating-leaves::after {
    content: '🍁';
    position: absolute;
    color: #F5D800;
    font-size: 20px;
    animation: float 8s ease-in-out infinite;
    opacity: 0.6;
}

.floating-leaves::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 10s;
}

.floating-leaves::after {
    top: 60%;
    right: 15%;
    animation-delay: 4s;
    animation-duration: 12s;
}

.maple-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.maple-particles::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: #4A90E2;
    border-radius: 50%;
    top: 30%;
    left: 80%;
    animation: float 6s ease-in-out infinite;
    box-shadow: 
        0 0 10px #4A90E2,
        20px 20px 0 #7ED321,
        40px 10px 0 #9013FE,
        -20px 30px 0 #D0021B;
}

/* Navigation enhancements */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #F5D800, #f59e0b);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Enhanced hover effects */
.group:hover .group-hover\\:scale-110 {
    transform: scale(1.1);
}

.group:hover .group-hover\\:scale-105 {
    transform: scale(1.05);
}

/* Card animations */
@keyframes card-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.card-shine:hover::after {
    animation: card-shine 0.6s ease;
}

/* Utility animations */
.animate-fade-in {
    animation: fade-in 1s ease-out;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
    .font-pixel {
        font-size: 0.8em;
    }
    
    .maple-particles::before {
        display: none;
    }
    
    .floating-leaves::before,
    .floating-leaves::after {
        font-size: 14px;
    }
}

/* Performance optimizations */
* {
    transform-style: preserve-3d;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus states for accessibility */
button:focus,
a:focus {
    outline: 2px solid #F5D800;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .floating-leaves,
    .maple-particles {
        display: none;
    }
}

/* Cleaned up - redundant animations removed */

/* Header text glow effect */
.text-glow {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor;
    animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor;
    }
    to {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor;
    }
}

/* Navigation improvements */
nav {
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

nav a {
    position: relative;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #facc15, #f59e0b);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
    position: relative;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-hover:hover::before {
    opacity: 1;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Button enhancements */
button, .btn {
    position: relative;
    overflow: hidden;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button::before, .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

button:hover::before, .btn:hover::before {
    left: 100%;
}

/* Countdown timer enhancements */
.countdown-digit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #facc15;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.countdown-digit::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Class cards special effects */
.class-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid;
    position: relative;
    overflow: hidden;
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    animation: borderScan 2s linear infinite;
}

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

/* News cards */
article {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(15px);
}

article:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Form styling */
input[type="email"] {
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
}

input[type="email"]:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Footer improvements */
footer {
    border-top: 2px solid #facc15;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 100%);
    backdrop-filter: blur(20px);
}

/* Back to top button */
#backToTop {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

/* Mobile menu animation */
@media (max-width: 768px) {
    .mobile-menu {
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-menu.active {
        transform: translateY(0);
    }
}

/* Loading animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(250, 204, 21, 0.3);
    border-top: 3px solid #facc15;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design improvements */
@media (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem !important;
    }
    
    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    nav .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .text-4xl {
        font-size: 1.5rem;
    }
    
    .text-6xl {
        font-size: 2rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .class-card {
        margin: 0 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background: #000;
        color: #fff;
    }
    
    .bg-gradient-to-br {
        background: #000 !important;
    }
    
    button, .btn {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    nav, footer, #backToTop, .floating-particles {
        display: none;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
}