/* Custom Styles for Sattari Automobile */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #1e3a8a; /* Match section background to prevent white flash */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

/* Premium Font Styling */
.premium-font {
    font-family: 'Playfair Display', serif;
    font-weight: 300;
    letter-spacing: 0.1em;
}

/* Text Shadow Effects */
.text-shadow-lg {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 4px 4px 16px rgba(0, 0, 0, 0.4);
}

/* Image Overlay Styles */
.image-overlay {
    transition: all 0.3s ease;
}

.image-overlay:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Custom Colors */
.bg-sattari-blue {
    background-color: #1e3a8a;
}

.text-sattari-blue {
    color: #1e3a8a;
}

/* Navigation Styles */
#navbar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#navbar.translate-y-0 {
    transform: translateY(0) !important;
}

#navbar.-translate-y-full {
    transform: translateY(-100%) !important;
}

/* Navigation Links */
nav a {
    position: relative;
    transition: all 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 100%;
}

/* Section Layouts */
section {
    min-height: 100vh;
    display: flex;
    margin: 0;
    padding: 0;
}

section.flex {
    align-items: stretch;
}

/* Ensure no gaps between sections */
section + section {
    margin-top: 0;
}

/* Dynamic viewport height support */
@supports (height: 100dvh) {
    section {
        min-height: 100dvh;
    }
    
    #hero {
        height: 100dvh;
    }
}

/* Fallback for older browsers */
@supports not (height: 100dvh) {
    section {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
    
    #hero {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
    }
}

/* Responsive Design - Now handled by Tailwind responsive classes in HTML */

/* Mobile Spacing Fixes */
@media (max-width: 1023px) {
    /* Dynamic viewport height for mobile */
    #hero {
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    /* Hero subsections should split the viewport */
    #hero .h-1\/2 {
        height: 50vh;
        height: 50dvh;
        min-height: 50vh;
        min-height: 50dvh;
    }
    
    /* Other sections use auto height except team */
    section:not(#hero):not(#team) {
        min-height: auto !important;
        height: auto !important;
    }
    
    /* Contact section should also be auto height on mobile */
    #contact {
        height: auto !important;
        min-height: auto !important;
    }
    
    /* Section 2 - Experience */
    #experience {
        display: block !important;
        height: auto !important;
    }
    
    #experience .flex {
        display: block !important;
    }
    
    #experience .bg-sattari-blue {
        padding-top: 2rem;
        padding-bottom: 2rem;
        min-height: auto;
        height: auto;
    }
    
    #experience .flex-col {
        height: auto !important;
    }
    
    #experience .h-1\/2 {
        height: 300px;
        min-height: 300px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ensure text overlay stays centered */
    #experience .h-1\/2 .absolute.inset-0.flex {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Section 3 - Services */
    #services {
        display: block !important;
        height: auto !important;
    }
    
    #services .bg-white {
        padding-top: 2rem;
        padding-bottom: 2rem;
        min-height: auto;
        height: auto;
    }
    
    #services .order-1 {
        order: 1 !important;
    }
    
    #services .order-2 {
        order: 2 !important;
    }
}

/* Image Optimizations */
img {
    max-width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/* Loaded state - applied via JavaScript */
img.loaded {
    opacity: 1;
}

/* Special handling for background images with opacity */
.opacity-20.loaded {
    opacity: 0.2;
}

.opacity-30.loaded {
    opacity: 0.3;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Text Shadows for Better Readability */
.text-overlay {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Hover Effects */
a {
    transition: all 0.3s ease;
}

a:hover {
    transform: translateY(-2px);
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Additional Mobile Fixes */
@media (max-width: 768px) {
    /* Fix experience section image text centering */
    #experience .relative {
        position: relative;
        overflow: hidden;
    }
    
    #experience .relative > .absolute {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    /* Ensure hero takes full viewport */
    #hero {
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    /* Let hero subsections fill half viewport each */
    #hero .h-1\/2 {
        height: 50vh;
        height: 50dvh;
        min-height: 50vh;
        min-height: 50dvh;
        flex: 1 1 50%;
    }
    
    /* Ensure proper flex container */
    #hero > div {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    /* Remove all gaps between sections */
    section {
        margin: 0 !important;
    }
    
    #experience {
        margin-top: 0;
        padding-top: 0;
    }
    
    #services {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Ensure sections connect seamlessly */
    #hero + #experience,
    #experience + #services,
    #services + #team,
    #team + #contact {
        margin-top: 0 !important;
    }
    
    /* Adjust padding for better mobile experience */
    #hero .px-4 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    /* Ensure text doesn't get too close to edges */
    #hero h1 {
        padding: 0 1rem;
    }
}

/* Team section specific height handling */
@media (max-width: 1023px) {
    #team {
        min-height: auto;
        height: auto;
    }
}

/* Print Styles */
@media print {
    section {
        page-break-inside: avoid;
        min-height: auto;
    }
    
    .bg-sattari-blue {
        background-color: #f3f4f6 !important;
        -webkit-print-color-adjust: exact;
    }
    
    .text-white {
        color: #000 !important;
    }
}