/* ========================================
   Auto Taysir - Professional Styles
   Premium Auto Repair Website
   ======================================== */

/* CSS Variables */
:root {
    --primary: #0f172a;
    --secondary: #1e293b;
    --accent: #dc2626;
    --accent-hover: #b91c1c;
    --gold: #fbbf24;
    --text-light: #f8fafc;
    --text-gray: #64748b;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Animations
   ======================================== */

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ========================================
   Navigation
   ======================================== */

nav {
    position: fixed !important;
    top: 52px !important;
    left: 0;
    right: 0;
    backdrop-filter: blur(20px);
    background: rgba(15, 23, 42, 0.98) !important;
    z-index: 50;
}

nav.scrolled {
    background: rgba(15, 23, 42, 1) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

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

/* Mobile Menu */
#mobile-menu {
    background: rgba(15, 23, 42, 0.98);
    border-radius: 0 0 1rem 1rem;
}

.mobile-link {
    padding-left: 1rem;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.mobile-link:hover {
    border-left-color: var(--accent);
    background: rgba(220, 38, 38, 0.1);
}

/* ========================================
   Hero Section
   ======================================== */

.hero-section {
    position: relative;
}

/* ========================================
   Service Cards
   ======================================== */

.service-card {
    transform: translateY(0);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
}

/* Service CTA Buttons */
.service-cta {
    position: relative;
    overflow: hidden;
}

.service-cta::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;
}

.service-cta:hover::before {
    left: 100%;
}

/* ========================================
   Forms & Inputs
   ======================================== */

input, textarea, select {
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

input.error, textarea.error, select.error {
    border-color: var(--accent);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Form Loading State */
.form-loading {
    pointer-events: none;
    opacity: 0.7;
}

.form-loading #submit-btn {
    position: relative;
    color: transparent;
}

.form-loading #submit-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   Buttons
   ======================================== */

button {
    cursor: pointer;
    transition: var(--transition);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========================================
   Scrollbar
   ======================================== */

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

::-webkit-scrollbar-track {
    background: var(--primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), #ef4444);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-hover), #dc2626);
}

/* ========================================
   Back to Top
   ======================================== */

#back-to-top {
    transition: var(--transition);
}

#back-to-top.visible {
    transform: translateY(0);
    opacity: 1;
}

#back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-5px);
}

/* ========================================
   Trust Badges
   ======================================== */

.trust-badge {
    transition: var(--transition);
}

.trust-badge:hover {
    transform: scale(1.1);
}

/* ========================================
   Testimonials
   ======================================== */

#testimonials .bg-white {
    transition: var(--transition);
}

#testimonials .bg-white:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Footer
   ======================================== */

footer a {
    position: relative;
}

footer a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: var(--transition);
}

footer a:hover::before {
    width: 100%;
}

/* ========================================
   Accessibility
   ======================================== */

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

/* Focus Visible */
a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    nav, .hero-section, footer, #back-to-top {
        display: none !important;
    }
    section {
        page-break-inside: avoid;
    }
    body {
        background: white;
        color: black;
    }
    #success-qr {
        display: block !important;
    }
}

/* ========================================
   QR Code Styles
   ======================================== */

#qrcode {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 16px;
}

#qrcode img {
    display: block !important;
    margin: 0 auto !important;
}

/* ========================================
   Radio Button Cards (Service Selection)
   ======================================== */

input[type="radio"]:checked + div {
    border-color: var(--accent);
    background: rgba(220, 38, 38, 0.1);
}

input[type="radio"] + div:hover {
    border-color: var(--accent);
}

/* ========================================
   Before/After Image Comparison
   ======================================== */

.before-after-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.before-after-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   Loading Skeleton
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ========================================
   Utility Classes
   ======================================== */

.text-gradient {
    background: linear-gradient(135deg, var(--accent), #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.3);
}

.shadow-glow-lg {
    box-shadow: 0 0 50px rgba(220, 38, 38, 0.4);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Success/Error States
   ======================================== */

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    animation: fadeIn 0.2s ease-out;
}

.success-message {
    color: #10b981;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ========================================
   Tab Hidden (Performance)
   ======================================== */

body.tab-hidden * {
    animation: none !important;
    transition: none !important;
}
