/* --- Complete CSS for AY Construction Ltd Website (Minimalist, High-Contrast Style) --- */

/* 1. Global Reset & Variables (Updated for Minimalist Aesthetic) */

:root {
    /* Updated Color Palette */
    --color-primary: #007bff;        /* Bright Blue for accents and action */
    --color-secondary: #1a1a1a;      /* Deep Black for primary contrast */
    --color-accent: #00bcd4;         /* Cyan/Teal for secondary highlights */
    --color-text-light: #ffffff;     /* White text */
    --color-text-dark: #1a1a1a;      /* Black text */
    --color-bg-light: #f4f4f4;       /* Off-White background for content */
    --color-bg-dark: #1a1a1a;

    /* Typography (Clean, Modern) */
    --font-heading: 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Helvetica Neue', Arial, sans-serif;

    /* Spacing */
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 40px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-dark);
    line-height: 1.6;
    background-color: var(--color-bg-light);
    padding-top: 80px; /* Space for the fixed nav bar */
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-text-dark);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--color-primary);
}

/* 2. Navigation Bar (Transparent to Dark Scroll Effect) */

.hero-banner {
  position: relative;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  color: white;
  text-align: center;
  background-color: #0a2342; /* Blueprint blue base */
}

/* Blueprint grid background */
.blueprint-bg {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(#0d2b55 1px, transparent 1px),
    linear-gradient(90deg, #0d2b55 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.2;
  z-index: 1;
}

/* SVG blueprint lines that draw themselves */
.blueprint-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.blueprint-lines path {
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: draw 3s ease-out forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Hero text animation */
.anime {
  position: relative;
  z-index: 5;
  animation: fadeUp 2s ease-out forwards;
  max-width: 800px;
  padding: 0 20px;
}

.anime h1 {
  font-size: 2.8rem;
  letter-spacing: 1px;
  margin-bottom: 15px;
  text-transform: uppercase;
  color: #FFFFFF;
  text-shadow: 0 0 8px rgba(255,255,255,0.2);
}

.anime p {
  font-size: 1.2rem;
  margin-bottom: 25px;
  color: #E0E6ED;
}

.cta-button {
  background-color: #f1c40f;
  color: #1a1a1a;
  font-weight: bold;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.3s;
}

.cta-button:hover {
  background-color: #ffcc00;
  transform: translateY(-3px);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .anime h1 {
    font-size: 2rem;
  }
  .anime p {
    font-size: 1rem;
  }
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background-color: transparent; /* Start transparent */
    padding: var(--spacing-sm) 0;
    box-shadow: none;
    transition: background-color 0.3s, box-shadow 0.3s;
    background-color:#06162a ;
}

/* Active style when scrolled (triggered by index.js) */
nav.scrolled {
    background-color: rgba(10, 35, 66, 0.75); /* Deep Black on scroll */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);

}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text-light); /* Logo is always light */
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.nav-links a {
    color: var(--color-text-light);
    margin-left: var(--spacing-lg);
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s;
    position: relative; 
    text-decoration: none;
}


.nav-links a::after {
    content: '';
    position: absolute;
    width: 0; 
    height: 2px;
    bottom: -5px; 
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s ease-out;
}


.nav-links a:hover {
    color: var(--color-accent);
}


.nav-links a:hover::after {
    width: 100%;
}


.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    outline: none;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--color-text-light);
    margin: 5px 0;
    transition: all 0.3s;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-secondary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.mobile-menu a {
    display: block;
    padding: 15px var(--spacing-md);
    text-align: center;
    color: var(--color-text-light);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 3. Hero Video Section (Full Screen & Bold) */

.container1 {
    position: relative;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -80px;
}

.vid {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

.container1::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55); /* Darker overlay for text contrast */
    z-index: 2;
}

.anime {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 20px;
    max-width: 900px;
}

.anime h1 {
    font-size: 4.5rem; /* Bigger Headline */
    color: var(--color-text-light);
    margin-bottom: 10px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    font-weight: 900;
}

.anime p {
    font-size: 1.5rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.cta-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: 15px 30px;
    border-radius: 0; /* Square edges for modern look */
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.2s;
}

.cta-button:hover {
    background-color: var(--color-accent);
    color: var(--color-text-dark);
    transform: scale(1.05);
}

/* 4. Core Values Section (Clean and Separated) */

.core-values {
    display: flex;
    justify-content: space-around;
    padding: calc(var(--spacing-lg) * 2) 0;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    background-color: var(--color-bg-light);
}

.value-box {
    width: 30%;
    padding: var(--spacing-md);
    transition: box-shadow 0.3s;
    border-bottom: 3px solid var(--color-primary);
}

.value-box:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.value-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.value-title {
    font-size: 1.5rem;
    color: var(--color-secondary);
    margin-bottom: 10px;
    font-weight: 900;
}

/* 5. Highlight Section (Inverted High Contrast) */

.highlight-section {
    background-color: var(--color-bg-light); /* Light background */
    color: var(--color-text-dark); /* Dark text */
    padding: calc(var(--spacing-lg) * 2) 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.highlight-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    align-items: center;
}

.highlight-img {
    flex: 1;
    padding-right: var(--spacing-lg);
}

.highlight-img img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: none; /* Flatter look */
    border: 1px solid #ddd;
}

.highlight-text {
    flex: 1;
}

.highlight-text h2 {
    color: var(--color-primary); /* Use primary blue for the heading */
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.highlight-text p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-lg);
}

.highligh-button {
    display: inline-block;
    background-color: var(--color-secondary); /* Deep black button */
    color: var(--color-text-light);
    padding: 12px 25px;
    border-radius: 0; /* Square edges */
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.2s;
}

.highligh-button:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    transform: scale(1.05);
}

/* 6. Project Gallery */

.projects {
    text-align: center;
    padding: calc(var(--spacing-lg) * 2) var(--spacing-md);
    max-width: 1200px;
    margin: 0 auto;
}

.projects h2 {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    color: var(--color-secondary);
}

.main-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.project {
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.project p {
    padding: 10px;
    font-weight: bold;
    background-color: var(--color-text-light);
    color: var(--color-secondary);
}

/* 7. Lightbox Overlay (Hidden by default, shown by JS) */

.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
}

.lightbox-content img {
    width: 100%;
    display: block;
    border-radius: 4px;
}

.lightbox .close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox .close:hover,
.lightbox .close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox .prev,
.lightbox .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox .next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox .prev:hover,
.lightbox .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.lightbox #caption {
    margin: 15px auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
}

/* 8. Services CTA Section */

.services-cta {
    background-color: var(--color-secondary); /* Deep Black CTA background */
    padding: calc(var(--spacing-lg) * 1.5) 0;
    text-align: center;
    color: var(--color-text-light);
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
}

.services-cta h2 {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.services-cta p {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
}

.btn-service {
    background-color: var(--color-text-light);
    color: var(--color-primary);
    padding: 12px 30px;
    border-radius: 0; /* Square edges */
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s;
}

.btn-service:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}

/* 9. Review and Social Sections */

.Reviewdiv {
    max-width: 800px;
    margin: var(--spacing-lg) auto;
    padding: var(--spacing-md);
    text-align: center;
    border-bottom:1px ;
}

.Reviewdiv h2 {
    margin-bottom: var(--spacing-md);
    color: var(--color-secondary);
}

#reviewForm input,
#reviewForm textarea {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

#reviewForm button {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: 12px 25px;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s;
}

#reviewForm button:hover {
    background-color: var(--color-secondary);
}

.star {
    font-size: 1.5rem;
    color: #ccc;
    cursor: pointer;
    margin: 0 2px;
    transition: color 0.2s;
}

.star.active {
    color: var(--color-accent); /* Teal/Cyan color for active stars */
}

.social-icons {
    text-align: center;
    padding: var(--spacing-md) 0;
}

.social-icon {
    width: 35px;
    height: 35px;
    margin: 0 10px;
    transition: transform 0.2s;
}

.social-icon:hover {
    transform: scale(1.1);
}

/* 10. Footer */

footer {
    background-color: var(--color-secondary);
    color: var(--color-text-light);
    padding: var(--spacing-lg) 0;
    text-align: center;
}

footer .container p {
    margin: 5px 0;
}

footer a {
    color: var(--color-accent);
    transition: color 0.3s;
}

footer a:hover {
    color: var(--color-primary);
}

/* 11. Media Queries (Mobile Responsiveness) */

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    /* HERO */
    .anime h1 {
        font-size: 2.5rem;
    }

    .anime p {
        font-size: 1.2rem;
    }

    .logo img {
        height: 30px;

    }

    /* NAVIGATION */
    .nav-container {
        padding: 0 var(--spacing-sm);
    }
    
    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
        z-index: 110;
    }

    .mobile-menu.active {
        display: block;
        padding-bottom: 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }


    /* CORE VALUES */
    .core-values {
        flex-direction: column;
        padding: var(--spacing-md);
    }

    .value-box {
        width: 100%;
        margin-bottom: var(--spacing-md);
    }

    /* HIGHLIGHT */
    .highlight-section {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .highlight-container {
        flex-direction: column;
    }

    .highlight-img {
        padding-right: 0;
        margin-bottom: var(--spacing-md);
    }
    
    .highlight-text h2 {
        font-size: 2rem;
    }
    
    /* GALLERY */
    .projects h2 {
        font-size: 2.5rem;
    }

    /* REVIEWS */
    #reviewForm input,
    #reviewForm textarea {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    
    /* 1. Target the main NAV container */
    nav {
        /* Reduce the overall padding/height of the nav bar */
        padding: 10px 20px; 
    }

    /* 2. Target the Logo (Text and Image) */
    .nav-container .logo {
        /* Reduce padding around the logo text/image */
        font-size: 1.1em;
        padding: 5px 0;
    }

    /* 3. Target the Logo Image */
    .nav-container .logo img {
        /* Greatly reduce the image height */
        height: 40px !important; /* Forces the height on mobile */
        width: auto;
    }
    
    /* 4. Ensure the Mobile Menu (when open) is also sleek */
    .mobile-menu a {
        /* Reduce padding within the mobile menu links */
        padding: 10px 0; 
        font-size: 1em;
    }
}

/* ======================================= */
/* NEW: PRELOADER STYLES */
/* ======================================= */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Choose a color that fits your brand */
    background-color: #2c3e50; 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Must be on top of everything */
    opacity: 1;
    visibility: visible;
    /* This transition is key for the smooth fade-out */
    transition: opacity 1s ease-out, visibility 1s ease-out; 
}

/* Class added by JavaScript on window.load to trigger the fade-out */
.page-loaded #preloader {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preloader-logo {
    animation: pulse 1.5s infinite; /* Subtle animation for the logo */
}

/* Spinning Loader */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3); /* Light ring */
    border-top: 4px solid #f39c12; /* Brand color top arc */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin-top: 15px;
}

/* ======================================= */
/* KEYFRAMES */
/* ======================================= */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes bigBangFadeIn {
    0% {
        opacity: 0;
        transform: translateY(50px); /* Start slightly below */
    }
    100% {
        opacity: 1;
        transform: translateY(0); /* End at original position */
    }
}

/* Defines the animation for the video (optional, but adds drama) */
@keyframes videoScaleIn {
    0% {
        transform: scale(1.05); /* Start slightly zoomed in */
    }
    100% {
        transform: scale(1); /* End at normal scale */
    }
}

/* ======================================= */
/* 2. HOME SECTION STYLES (MODIFIED) */
/* ======================================= */

#home {
    /* Ensure the home section is ready for the animation */
    overflow: hidden; 
    position: relative;
    /* ... existing styles ... */
}

/* Base style for the video before it animates */
.vid {
    /* Add initial video scale animation */
    animation: videoScaleIn 2s ease-out forwards;
    /* ... existing video styles ... */
}

/* Base styles for the content that appears with a dramatic entrance */
.anime {
    /* Initial state before animation */
    opacity: 0; 
    transition: opacity 0.5s ease-out; 
    
    /* Apply the animation when the page is fully loaded and revealed */
    /* Use a delay to ensure the preloader is completely gone first (1s preloader + 0.1s gap) */
    /* The 'bigBangFadeIn' animation runs for 1.5 seconds after the delay */
    animation: bigBangFadeIn 1.5s ease-out 1.1s forwards; 
    /* ... existing .anime styles ... */
}

.anime h1 {
    /* Optional: Delay the heading slightly more than the container */
    animation-delay: 1.2s; 
    /* ... existing h1 styles ... */
}

.anime .cta-button {
    /* Optional: Delay the button slightly more than the heading */
    animation-delay: 1.5s; 
    /* ... existing button styles ... */
}

/* ======================================= */
/* 1. ENHANCED PRELOADER SCREEN STYLES */
/* ======================================= */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use a sleek, contrasting base color */
    background-color: #f5f5f5; /* Light Grey or White for a clean start */ 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out; 
}

/* Class added by JavaScript to hide the preloader after loading */
.page-loaded #preloader {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}



.preloader-logo {
    width: 100px; /* Reduced slightly for focus */
    height: 100px;
    margin-bottom: 20px;
    
    /* NEW: Animation for the logo to draw attention */
    animation: fadeInScale 1s ease-out forwards;
}

/* NEW: Loading Text */
.loading-text {
    color: #2c3e50; /* Dark text matching the brand */
    font-family: sans-serif;
    font-size: 0.9em;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0; /* Starts hidden */
    animation: fadeInText 0.5s ease-in 1.2s forwards; /* Fades in after logo appears */
}

/* Stylish Spinner: Using a subtle dot chase effect for elegance */
.spinner {
    width: 40px;
    height: 40px;
    position: relative;
    /* Use brand color for the loading element */
    border: none; 
}

.spinner:before, .spinner:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #f39c12; /* Brand Orange/Yellow color */
    opacity: 0.6;
    animation: dotChase 2.0s infinite ease-in-out;
}

.spinner:after {
    background-color: #3498db; /* Secondary Blue color */
    animation-delay: -1.0s;
}

/* ======================================= */
/* 2. KEYFRAMES FOR ENHANCED ANIMATION */
/* ======================================= */

/* For the Logo to appear dramatically */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* For the Loading Text */
@keyframes fadeInText {
    to {
        opacity: 1;
    }
}

/* Dot Chase/Pulse Animation for the Spinner */
@keyframes dotChase {
    0%, 100% {
        transform: scale(0.0);
    }
    50% {
        transform: scale(1.0);
    }
}