/*
 * PASARMOBKAS - Optimized Custom CSS
 * Primary Color: #4A9782 (Teal Green)
 * Performance-focused version
 */

:root {
    /* Brand Colors */
    --primary: #4A9782;
    --primary-dark: #3d7f6d;
    --primary-light: #5eac96;
    --secondary: #2D3748;
    --accent: #ED8936;

    /* Surface Colors */
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;

    /* Glassmorphism - Optimized */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

    /* Spacing */
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

/* ========================================
   PREMIUM LOGO STYLING
   ======================================== */

/* Logo container hover effect */
.logo-container {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container:hover .logo-main {
    transform: scale(1.05);
}

.logo-container:hover .logo-accent {
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Main logo text */
.logo-main {
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gold accent for .ID */
.logo-accent {
    color: #FFD700;
    font-weight: 900;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
}

/* Subtle shine effect on .ID */
.logo-accent::after {
    content: '.ID';
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tagline styling */
.logo-tagline {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #718096;
    margin-top: 2px;
    transition: color 0.3s ease;
}

.logo-container:hover .logo-tagline {
    color: #4A9782;
}

/* Mobile logo adjustments */
@media (max-width: 1024px) {
    .logo-main {
        font-size: 1.125rem;
    }

    .logo-tagline {
        display: none;
    }
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: linear-gradient(135deg, #fafbfc 0%, #f1f4f6 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* Ensure all form elements have black text */
select,
input,
textarea,
button {
    color: #1a202c !important;
}

select option {
    color: #1a202c !important;
}

/* Optimized background - removed heavy animated blobs on mobile */
@media (min-width: 769px) {
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background:
            radial-gradient(ellipse at 15% 25%, rgba(74, 151, 130, 0.04) 0%, transparent 50%),
            radial-gradient(ellipse at 85% 75%, rgba(74, 151, 130, 0.03) 0%, transparent 50%);
        z-index: 0;
        pointer-events: none;
    }
}

body > * {
    position: relative;
    z-index: 1;
}

/* ========================================
   GLASSMORPHISM - OPTIMIZED
   ======================================== */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-primary);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .glass-card {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* ========================================
   PREMIUM TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
}

/* ========================================
   BUTTONS - OPTIMIZED
   ======================================== */

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 151, 130, 0.3);
}

.glass-button {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

/* ========================================
   CARDS - OPTIMIZED
   ======================================== */

.car-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.car-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.guarantee-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(74, 151, 130, 0.08);
    transition: all 0.3s ease;
}

.guarantee-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(74, 151, 130, 0.12);
    border-color: rgba(74, 151, 130, 0.15);
}

.guarantee-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   HERO CAROUSEL - OPTIMIZED & ENHANCED
   ======================================== */

.hero-carousel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(74, 151, 130, 0.05) 0%, rgba(45, 55, 72, 0.05) 100%);
    min-height: 500px;
}

.carousel-slide {
    display: none;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    display: block;
    opacity: 1;
}

/* ========================================
   BOTTOM NAVIGATION BAR - ENHANCED
   ======================================== */

.carousel-nav-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 20;
}

.carousel-nav-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.carousel-arrow {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 2px solid rgba(74, 151, 130, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08),
                0 2px 6px rgba(0, 0, 0, 0.04);
}

.carousel-arrow:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(74, 151, 130, 0.25),
                0 4px 10px rgba(74, 151, 130, 0.15);
}

.carousel-arrow:active {
    transform: translateY(0) scale(0.98);
}

.carousel-dots-container {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(74, 151, 130, 0.08);
    border-radius: 20px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(74, 151, 130, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dot:hover {
    background: rgba(74, 151, 130, 0.5);
    transform: scale(1.3);
}

.carousel-dot.active {
    background: var(--primary);
    transform: scale(1.4);
    box-shadow: 0 0 0 4px rgba(74, 151, 130, 0.15);
}

.carousel-counter {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.5px;
    min-width: 90px;
    text-align: center;
    padding: 0.4rem 0.8rem;
    background: rgba(74, 151, 130, 0.08);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.carousel-counter span {
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
}

/* ========================================
   STEP NUMBER
   ======================================== */

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* ========================================
   UTILITIES
   ======================================== */

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.favorite-btn {
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.active {
    color: #ef4444;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

/* Badge */
.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-hot {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
}

.price-tag {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
}

/* Testimonial Card */
.testimonial-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    animation: slideUp 0.3s ease;
}

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

/* ========================================
   TOAST
   ======================================== */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    z-index: 3000;
    animation: slideInRight 0.3s ease;
}

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

.toast.success {
    background-color: var(--primary);
}

.toast.error {
    background-color: #ef4444;
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.spinner {
    border: 4px solid rgba(74, 151, 130, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   IMAGE LAZY LOAD
   ======================================== */

img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ========================================
   MOBILE MENU
   ======================================== */

.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateX(0);
}

.overlay {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Better responsive grid */
@media (max-width: 480px) {
    .container,
    section {
        padding-left: 0.875rem !important;
        padding-right: 0.875rem !important;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    .container,
    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Better text sizing */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

/* Improved touch targets */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* But allow text links to be normal */
    a:not(.btn):not([role="button"]) {
        min-height: auto;
        min-width: auto;
    }
}

/* Better responsive spacing */
@media (max-width: 480px) {
    .py-12 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
    .py-16 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    .py-20 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
}

/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .mobile-bottom-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    max-width: 100vw;
}

* {
    max-width: 100%;
}

/* Better responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Better responsive tables */
@media (max-width: 640px) {
    table {
        font-size: 0.875rem;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZED
   ======================================== */

@media (max-width: 768px) {
    .hero-carousel {
        min-height: 300px;
        height: 35vh;
    }

    .carousel-nav-container {
        padding: 1rem 1rem;
    }

    .carousel-nav-content {
        max-width: 100%;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .carousel-arrow {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .carousel-dots-container {
        gap: 7px;
        padding: 0.35rem 0.75rem;
        border-radius: 16px;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    .carousel-dot.active {
        box-shadow: 0 0 0 3px rgba(74, 151, 130, 0.15);
    }

    .carousel-counter {
        font-size: 11px;
        min-width: 75px;
        padding: 0.3rem 0.6rem;
        border-radius: 8px;
    }

    .carousel-counter span {
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .carousel-nav-container {
        padding: 0.875rem 0.75rem;
    }

    .carousel-nav-content {
        gap: 0.5rem;
        padding: 0 0.25rem;
    }

    .carousel-arrow {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        border-width: 1.5px;
    }

    .carousel-dots-container {
        gap: 6px;
        padding: 0.3rem 0.6rem;
        border-radius: 14px;
    }

    .carousel-dot {
        width: 7px;
        height: 7px;
    }

    .carousel-counter {
        font-size: 10px;
        min-width: 65px;
        padding: 0.25rem 0.5rem;
        letter-spacing: 0.25px;
    }

    .carousel-counter span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .carousel-nav-container {
        padding: 0.75rem 0.5rem;
    }

    .carousel-arrow {
        width: 36px;
        height: 36px;
    }

    .carousel-dots-container {
        gap: 5px;
        padding: 0.25rem 0.5rem;
    }

    .carousel-dot {
        width: 6px;
        height: 6px;
    }

    .carousel-dot.active {
        transform: scale(1.3);
        box-shadow: 0 0 0 2px rgba(74, 151, 130, 0.15);
    }
}

@media (max-width: 375px) {
    .carousel-nav-container {
        padding: 0.625rem 0.5rem;
    }

    .carousel-arrow {
        width: 34px;
        height: 34px;
    }

    .carousel-dots-container {
        gap: 4px;
        padding: 0.2rem 0.4rem;
    }

    .carousel-dot {
        width: 5px;
        height: 5px;
    }

    .carousel-counter {
        font-size: 9px;
        min-width: 55px;
        padding: 0.2rem 0.4rem;
    }
}

/* ========================================
   PREFERENCES
   ======================================== */

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