/* Custom Styles for Smooth Animations */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Smooth Transitions for All Elements */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Enhanced Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Smooth Fade In Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger Animation Delay */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth Navbar Background Change */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .navbar-scrolled {
    background: rgba(17, 24, 39, 0.95) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Map Container Styling */
#map {
    border-radius: 1rem;
    overflow: hidden;
}

/* Custom Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Smooth Card Animations */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin 3s linear infinite;
}

/* Pulse Animation */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.8);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Smooth Section Transitions */
section {
    position: relative;
    overflow: hidden;
}

/* Custom Focus Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 4px;
    ring-color: rgba(59, 130, 246, 0.3);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Reduce animation intensity on mobile */
    .hover-lift:hover {
        transform: translateY(-4px);
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GIF Slider Styles */
#gifSlider {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gif-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}

.gif-slide.active {
    display: block;
    opacity: 1;
}

.gif-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 1rem;
}

/* Optimize GIF loading */
img[src$=".gif"] {
    image-rendering: auto;
    will-change: contents;
}

/* Lazy loading optimization */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Ensure vehicle images are always visible */
img[alt*="Tesla"],
img[alt*="Phone"] {
    opacity: 1 !important;
    display: block;
}

/* Material Symbols Support */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-family: 'Material Symbols Outlined';
}

/* Glow border effect for cards */
.glow-border:hover {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
}

/* EV sales popup widget */
.sales-popup-container {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 50;
    pointer-events: none;
}

.sales-popup {
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.45);
    font-size: 0.8rem;
    max-width: 260px;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border: 1px solid rgba(59, 130, 246, 0.6);
    opacity: 0;
    transform: translateY(10px);
    animation: popup-in 0.35s ease-out forwards;
    pointer-events: auto;
}

.sales-popup-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sales-popup.hide {
    animation: popup-out 0.3s ease-in forwards;
}

.sales-popup-name {
    font-weight: 600;
    color: #e5e7eb;
}

.sales-popup-country {
    color: #9ca3af;
    font-size: 0.7rem;
}

.sales-popup-vehicle {
    color: #4ade80;
    font-weight: 600;
}

@keyframes popup-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popup-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}
