/* ===================================
   AppProdigy - Animations & Effects
   Scroll animations, transitions, glow
   =================================== */

/* ===== ANIMATED GRADIENT BACKGROUND ===== */
.hero {
    background: linear-gradient(-45deg, #0ea5e9, #8b5cf6, #06b6d4, #3b82f6);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.hero h1,
.hero p,
.hero .hero-buttons {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: white;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.hero .highlight {
    color: #fef08a;
    text-shadow: 0 0 30px rgba(254, 240, 138, 0.5);
}

.hero-subtitle {
    color: rgba(255,255,255,0.9) !important;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== FLOATING PARTICLES ===== */
.hero::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: floatParticles 20s linear infinite;
    opacity: 0.5;
    pointer-events: none;
}

@keyframes floatParticles {
    0% { transform: translateY(0); }
    100% { transform: translateY(-200px); }
}

/* ===== GLASSMORPHISM CARDS ===== */
.app-card,
.feature-card,
.contact-card,
.value-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ===== GLOW EFFECTS ===== */
.app-card:hover {
    box-shadow:
        0 20px 60px rgba(14, 165, 233, 0.2),
        0 0 40px rgba(139, 92, 246, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
}

.feature-card:hover {
    box-shadow:
        0 20px 60px rgba(14, 165, 233, 0.15),
        0 0 30px rgba(14, 165, 233, 0.1);
}

.btn-primary:hover,
.btn-gradient:hover {
    box-shadow:
        0 10px 40px rgba(14, 165, 233, 0.4),
        0 0 20px rgba(14, 165, 233, 0.2);
}

/* Neon glow for status badges */
.status-live {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.status-coming {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveal for grids */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.4s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.5s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.6s; }

.reveal-stagger.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* ===== ENHANCED HOVER EFFECTS ===== */
.app-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.app-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.feature-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
}

/* Icon bounce on card hover */
.app-card:hover .app-card-icon,
.feature-card:hover .feature-icon {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Link arrow animation */
.app-card-link {
    position: relative;
    overflow: hidden;
}

.app-card-link::after {
    transition: transform 0.3s ease;
}

.app-card:hover .app-card-link::after {
    transform: translateX(5px);
}

/* ===== BUTTON ENHANCEMENTS ===== */
.btn {
    position: relative;
    overflow: hidden;
}

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

/* Pulse animation for primary CTA */
.btn-gradient {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(14, 165, 233, 0); }
}

.btn-gradient:hover {
    animation: none;
}

/* ===== NAVBAR ENHANCEMENTS ===== */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

html.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(51, 65, 85, 0.5);
}

html.dark-mode .navbar.scrolled {
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

html.dark-mode .nav-links a {
    color: rgba(255, 255, 255, 0.7);
}

html.dark-mode .nav-links a:hover,
html.dark-mode .nav-links a.active {
    color: var(--primary-light);
}

html.dark-mode .hamburger,
html.dark-mode .hamburger::before,
html.dark-mode .hamburger::after {
    background: white;
}

html.dark-mode .mobile-nav {
    background: var(--bg);
    border-color: var(--border);
}

html.dark-mode .mobile-nav-links a {
    color: var(--text);
}

.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ===== LANGUAGE SWITCHER ANIMATION ===== */
.lang-toggle {
    position: relative;
    overflow: hidden;
}

.lang-dropdown-item {
    position: relative;
    overflow: hidden;
}

.lang-dropdown-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(14, 165, 233, 0.1);
    transform: translateY(-50%);
    transition: width 0.2s ease;
}

.lang-dropdown-item:hover::before {
    width: 100%;
}

.lang-dropdown-item.active::before {
    width: 100%;
    background: rgba(14, 165, 233, 0.15);
}

/* ===== DARK MODE ===== */
html.dark-mode {
    --bg: #0f172a;
    --bg-light: #1e293b;
    --bg-alt: #334155;
    --text: #f8fafc;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
}

html.dark-mode body {
    background: var(--bg);
    color: var(--text);
}

html.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--border);
}

html.dark-mode .app-card,
html.dark-mode .feature-card,
html.dark-mode .contact-card,
html.dark-mode .value-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(51, 65, 85, 0.5);
}

html.dark-mode .app-card:hover,
html.dark-mode .feature-card:hover,
html.dark-mode .contact-card:hover,
html.dark-mode .value-card:hover {
    box-shadow:
        0 20px 60px rgba(14, 165, 233, 0.15),
        0 0 30px rgba(139, 92, 246, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
}

html.dark-mode .section-title,
html.dark-mode h2,
html.dark-mode h3 {
    color: var(--text);
}

html.dark-mode .section[style*="bg-light"] {
    background: var(--bg-light) !important;
}

html.dark-mode .cta-section {
    background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%) !important;
}

html.dark-mode .download {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
}

/* Dark mode footer */
html.dark-mode .footer,
html.dark-mode .footer-simple {
    background: #0f172a;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
}

html.dark-mode .footer-grid {
    border-bottom-color: rgba(51, 65, 85, 0.5);
}

html.dark-mode .footer .logo,
html.dark-mode .footer-simple .logo {
    color: white !important;
}

html.dark-mode .footer-nav h4 {
    color: rgba(255, 255, 255, 0.5);
}

html.dark-mode .footer-nav a {
    color: rgba(255, 255, 255, 0.7);
}

html.dark-mode .footer-nav a:hover {
    color: white;
}

html.dark-mode .footer-tagline {
    color: rgba(255, 255, 255, 0.5);
}

html.dark-mode .footer-bottom {
    color: rgba(255, 255, 255, 0.5);
}

html.dark-mode .footer-simple-links a {
    color: rgba(255, 255, 255, 0.7);
}

html.dark-mode .footer-simple-links a:hover {
    color: white;
}

html.dark-mode .logo {
    color: var(--text);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.dark-mode-toggle:hover {
    background: var(--bg-light);
}

/* ===== STATS COUNTER ANIMATION ===== */
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 32px;
    text-align: center;
}

.stat-item {
    padding: 24px;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== GRAIN/TEXTURE OVERLAY ===== */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .hero::after {
        display: none; /* Disable particles on mobile for performance */
    }

    .stat-number {
        font-size: 2rem;
    }

    .reveal {
        transform: translateY(20px);
    }
}

/* ===== SMOOTH SCROLL ===== */
html {
    scroll-behavior: smooth;
}

/* ===== LOADING ANIMATION ===== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
