/**
 * AutoAds - Authentication Page Animations
 * Beautiful minimalistic animated backgrounds
 * Created by Diziukas 🎨
 */

/* Animated Gradient Background */
.auth-page, .hero, .animated-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(-45deg, #2563eb, #1e40af, #3b82f6, #60a5fa);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Hero specific adjustments */
.hero {
    min-height: auto;
    padding: 4rem 0;
    display: block;
}

.hero .container {
    position: relative;
    z-index: 10;
}

.hero .search-bar {
    position: relative;
    z-index: 11;
}

/* Animated section specific adjustments */
.animated-section {
    min-height: auto;
    padding: 4rem 0;
    display: block;
}

.animated-section .container {
    position: relative;
    z-index: 10;
}

.animated-section .section-title {
    position: relative;
    z-index: 10;
    color: white;
}

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

/* Floating Geometric Shapes */
.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Animated Dots Pattern */
.auth-page::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: driftDots 30s linear infinite;
    opacity: 0.3;
}

@keyframes driftDots {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Container fix for auth pages */
.auth-page .container {
    width: 100%;
}

/* Link styling for auth pages */
.auth-page .text-center a {
    color: white;
    text-decoration: underline;
}

.auth-page .text-center a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Form label styling for auth pages */
.auth-page .form-group label {
    color: white;
}

/* Navigation button styling */
.nav .btn-primary {
    color: white;
}

/* Auth Box Enhancement */
.auth-page .auth-box {
    position: relative;
    z-index: 10;
    max-width: 550px !important; /* Wider for forms with more fields */
    width: 100%;
    margin: 4rem auto;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 100px rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    animation: fadeInUp 0.8s ease-out;
}

/* Close Button */
.auth-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
}

.auth-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

.auth-close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

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

/* Animated Car Shapes */
.car-shape {
    position: absolute;
    opacity: 0.1;
    animation: driveby 20s linear infinite;
}

.car-shape:nth-child(1) {
    top: 20%;
    left: -10%;
    animation-delay: 0s;
}

.car-shape:nth-child(2) {
    top: 60%;
    left: -15%;
    animation-delay: 7s;
}

.car-shape:nth-child(3) {
    top: 40%;
    left: -12%;
    animation-delay: 14s;
}

@keyframes driveby {
    from {
        left: -10%;
        transform: translateX(0);
    }
    to {
        left: 110%;
        transform: translateX(0);
    }
}

/* Lane Lines Animation */
.lane-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0.08;
    overflow: hidden;
}

.lane {
    position: absolute;
    width: 4px;
    height: 60px;
    background: white;
    border-radius: 2px;
}

.lane-1 {
    left: 15%;
    animation: moveLane 2s linear infinite;
}

.lane-2 {
    left: 35%;
    animation: moveLane 2s linear infinite 0.5s;
}

.lane-3 {
    left: 55%;
    animation: moveLane 2s linear infinite 1s;
}

.lane-4 {
    left: 75%;
    animation: moveLane 2s linear infinite 1.5s;
}

@keyframes moveLane {
    0% {
        top: -60px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: floatParticle 10s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 8s; }
.particle:nth-child(2) { left: 20%; top: 80%; animation-delay: 2s; animation-duration: 12s; }
.particle:nth-child(3) { left: 30%; top: 40%; animation-delay: 4s; animation-duration: 10s; }
.particle:nth-child(4) { left: 50%; top: 60%; animation-delay: 1s; animation-duration: 11s; }
.particle:nth-child(5) { left: 70%; top: 30%; animation-delay: 3s; animation-duration: 9s; }
.particle:nth-child(6) { left: 80%; top: 70%; animation-delay: 5s; animation-duration: 13s; }
.particle:nth-child(7) { left: 90%; top: 50%; animation-delay: 2.5s; animation-duration: 10.5s; }
.particle:nth-child(8) { left: 15%; top: 90%; animation-delay: 4.5s; animation-duration: 11.5s; }

@keyframes floatParticle {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translate(100px, -100px);
        opacity: 0.8;
    }
    90% {
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .auth-page::after {
        background-size: 30px 30px;
    }

    .lane-lines {
        display: none; /* Hide lanes on mobile for performance */
    }

    .car-shape {
        display: none; /* Hide car shapes on mobile */
    }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
    .auth-page .auth-box {
        background: rgba(30, 41, 59, 0.95);
        color: white;
    }
}
