/* =================================
   STYLE.CSS — PAGE INDEX
   1. Global Styles
   2. Home Page (Hero, Services, About, Testimonials, Contact)
   3. Footer
   4. Animations
   5. Mobile Overrides
================================= */

/* =================================
   1. GLOBAL STYLES
================================= */
/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-base, 'Poppins', sans-serif);
}

html, body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

section {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Variables */
:root {
  /* COLORS */
  --color-primary: #2c3e50;
  --color-secondary: #3498db;
  --color-accent: #e74c3c;
  --color-light: #ecf0f1;
  --color-dark: #2c3e50;
  --color-text: #333;

  /* BACKWARD COMPATIBILITY */
  --primary: var(--color-primary);
  --secondary: var(--color-secondary);
  --accent: var(--color-accent);
  --light: var(--color-light);
  --dark: var(--color-dark);

  /* SHADOWS */
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
  --shadow: var(--shadow-sm);

  /* TYPOGRAPHY */
  --font-base: 'Poppins', sans-serif;
  --font-size-base: 16px;
  --font-size-h1: clamp(2rem, 4vw, 3.5rem);
  --font-size-h2: clamp(1.8rem, 3vw, 2.5rem);

  /* SPACING */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 40px;
  --space-xl: 80px;

  /* LAYOUT */
  --container-max: 1200px;
  --container-padding: clamp(40px, 4vw, 80px);

  /* HEADER */
  --header-height: 80px;
  --header-height-mobile: 60px;
  --logo-height: 45px;
  --cta-button-padding-y: 4px;
  --cta-button-padding-x: 8px;
}

/* Base body */
body {
    line-height: 1.6;
    color: var(--color-text);
    background-color: #f9f9f9;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--container-padding);
}

section {
    padding: 80px 0;
}

h1, h2, h3, h4 {
    margin-bottom: 20px;
    color: var(--peimary);
}

h1 { font-size: 3rem; line-height: 1.2; }
h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}
h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary);
}

p { margin-bottom: 20px; }

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::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: 0.5s;
}

.btn:hover::before { left: 100%; }
.btn:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-accent { background-color: var(--accent); }
.btn-accent:hover { background-color: #c0392b; }

/* =================================
   2. HOME PAGE SECTIONS
================================= */

/* ===== HEADER ===== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background-color: white;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* LOGO */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo img { 
    height: var(--logo-height); 
    width: auto; 
    display: block; }

/* Bigger logo text */
.logo span {
    font-size: 1.8rem;
    line-height: 1.2;
    color: var(--secondary);
}
.logo span strong { font-weight: 700; }

/* Desktop NAV */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}
.nav-menu a { text-decoration: none; color: var(--primary); font-weight: 600; }

/* CTA */
.header-cta {
    display: flex;
    flex-direction: column; /* stack button + phone */
    align-items: center;
    gap: 5px;
}
.header-cta .btn {
    padding: var(--cta-button-padding-y) var(--cta-button-padding-x);
}
.header-cta .phone-number {
    font-size: 0.9rem;
    color: var(--primary);
}

/* MOBILE TOGGLE */
.mobile-toggle {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('../images/trevs-hero1.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: var(--header-height);
    padding: 160px 0 100px;
}
.hero::before {
    content: '';
    position: absolute;
    top:0; left:0;
    width: 100%; height: 100%;
    background: linear-gradient(45deg, rgba(52,152,219,0.2), rgba(231,76,60,0.2));
    z-index: 0;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { color:white; font-size:3.5rem; margin-bottom:20px; opacity:0; transform:translateY(30px); animation:fadeInUp 1s ease forwards;}
.hero p { font-size:1.2rem; max-width:700px; margin:0 auto 30px; opacity:0; transform:translateY(30px); animation:fadeInUp 1s ease 0.3s forwards;}
.hero .btn { opacity:0; transform:translateY(30px); animation:fadeInUp 1s ease 0.6s forwards; }

/* ===== SERVICES ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
    gap:30px;
}
.service-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: white;
    border-radius:8px;
    overflow:hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity:0;
    transform:translateY(30px);
}
.service-card.animated { animation: fadeInUp 0.6s ease forwards; }
.service-card:nth-child(1){ animation-delay:0.1s; }
.service-card:nth-child(2){ animation-delay:0.2s; }
.service-card:nth-child(3){ animation-delay:0.3s; }
.service-card:nth-child(4){ animation-delay:0.4s; }
.service-card:nth-child(5){ animation-delay:0.5s; }
.service-card:nth-child(6){ animation-delay:0.6s; }

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    }
.service-img { height:200px; background-size:cover; background-position:center; transition: transform 0.5s ease;}
.service-card:hover .service-img { transform:scale(1.1); }
.service-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding:25px; }
.service-content .btn {
    margin-top: auto;
    }
.service-content h3 { margin-bottom:15px; color: var(--primary); }
.service-content p { margin-bottom:15px; }

/* ===== ABOUT ===== */
.about { background-color: var(--light); }
.about-container { display:flex; align-items:center; gap:50px; }
.about-text { flex:1; opacity:0; transform:translateX(-50px);}
.about-text.animated { animation:fadeInLeft 0.8s ease forwards;}
.about-image { flex:1; border-radius:8px; overflow:hidden; box-shadow: var(--shadow); opacity:0; transform:translateX(50px);}
.about-image.animated { animation:fadeInRight 0.8s ease forwards;}
.about-image img { width:100%; height:auto; display:block; transition:transform 0.5s ease; }
.about-image:hover img { transform: scale(1.05); }

/* ===== TESTIMONIALS ===== */
    .testimonials { 
    background-color: white; 
    padding-top: 20px;   /* reduce space above heading */
    padding-bottom: 20px; /* keep bottom consistent */
    }

    .testimonials h2 {
    margin-bottom: 10px;   /* was 50px globally */
    }

.testimonial-slider {
    position:relative;
    display: flex;
    align-items: center; /* vertical center */
    justify-content: center;
    max-width:800px;
    margin:0 auto; 
    overflow: hidden; 
    min-height: 400px;
    }

.testimonial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; 
    max-width: 700px;
    background-color: var(--light); 
    padding:30px; 
    border-radius:8px; 
    text-align:center; 
    box-shadow: var(--shadow); 
    opacity:0; 
    transition: all 0.5s ease;
    z-index: 1;
    box-sizing: border-box;
}

.testimonial.active {
    opacity: 1;
    z-index: 5; /* bring active slide above others */
}

.testimonial-prev,
.testimonial-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.testimonial-prev {
    left: 0px;
}

.testimonial-next {
    right: 0px;
}

.testimonial-text { 
    font-style: italic; 
    margin-bottom:20px; 
    position: relative;
}

.testimonial-text::before, .testimonial-text::after { 
        content:'"'; 
        font-size:2rem; 
        color: var(--secondary); 
        position:absolute; 
        opacity:0.5; 
}
.testimonial-text::before { 
    top:-10px; 
    left:-10px; }
    
.testimonial-text::after { 
    bottom:-20px; 
    right:-10px; }
    
.testimonial-author { 
    font-weight:600; 
    color: var(--primary); }

/* ===== CONTACT ===== */
.contact { background-color: var(--light); }
.contact-container { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:40px; }
.contact-info h3 { margin-bottom:20px; }
.contact-detail { display:flex; align-items:center; margin-bottom:15px; opacity:0; transform:translateX(-30px);}
.contact-detail.animated { animation:fadeInLeft 0.5s ease forwards; }
.contact-detail:nth-child(1){ animation-delay:0.1s; }
.contact-detail:nth-child(2){ animation-delay:0.2s; }
.contact-detail:nth-child(3){ animation-delay:0.3s; }
.contact-detail:nth-child(4){ animation-delay:0.4s; }
.contact-detail i { margin-right:15px; color: var(--secondary); font-size:1.2rem; transition: transform 0.3s ease;}
.contact-detail:hover i { transform: scale(1.2); }

.contact-form { opacity:0; transform:translateY(30px); }
.contact-form.animated { animation: fadeInUp 0.8s ease forwards; }
.contact-form input,
.contact-form textarea,
.contact-form select {
    width:100%;
    padding:12px;
    margin-bottom:20px;
    border:1px solid #ddd;
    border-radius:5px;
    transition:all 0.3s ease;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    border-color: var(--secondary);
    box-shadow:0 0 0 2px rgba(52,152,219,0.2);
    outline:none;
}
.contact-form textarea { height:150px; }

/* =================================
   3. FOOTER
================================= */
footer {
    background-color: var(--primary);
    color:white;
    padding:50px 0 20px;
}
.footer-container {
    display:grid;
    grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
    gap:40px;
    margin-bottom:40px;
}
.footer-logo h3 { color:white; margin-bottom:15px; }
.footer-links h4,
.footer-services h4 { color:white; margin-bottom:20px; }
.footer-links ul,
.footer-services ul { list-style:none; }
.footer-links li,
.footer-services li { margin-bottom:10px; }
.footer-links a,
.footer-services a { color:#ddd; text-decoration:none; transition: color 0.3s ease, padding-left 0.3s ease; }
.footer-links a:hover,
.footer-services a:hover { color: var(--secondary); padding-left:5px; }
.copyright { text-align:center; padding-top:20px; border-top:1px solid rgba(255,255,255,0.1); }

/* =================================
   4. ANIMATIONS
================================= */
@keyframes fadeInUp { from{opacity:0;transform:translateY(30px);} to{opacity:1;transform:translateY(0);} }
@keyframes fadeInLeft { from{opacity:0;transform:translateX(-50px);} to{opacity:1;transform:translateX(0);} }
@keyframes fadeInRight { from{opacity:0;transform:translateX(50px);} to{opacity:1;transform:translateX(0);} }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(52,152,219,0.7);} 70%{box-shadow:0 0 0 10px rgba(52,152,219,0);} 100%{box-shadow:0 0 0 0 rgba(52,152,219,0);} }
.pulse { animation:pulse 2s infinite; }

/* =================================
   5. MOBILE OVERRIDES
================================= */
@media(max-width:768px){
    body{font-size:14px;}
    .container{width:95%; padding:0 10px;}
    section{padding:50px 0 !important;}
    h1{font-size:1rem !important;}
    h2{font-size:1.8rem !important; margin-bottom:30px !important;}

    .nav-menu{
        position:fixed; 
        top:var(--header-height-mobile); 
        left:-100%; width:100%; 
        flex-direction:column; 
        align-items:center; 
        padding:20px 0; 
        transition:left 0.3s ease; 
        box-shadow:var(--shadow); 
        display:flex;
        background-color: rgba(255, 255, 255, 0.5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px); /* Safari */
        z-index: 1000;
    }
    .nav-menu a {
    font-size: 1.1rem; /* adjust bigger text for mobile */
    font-weight: 600;   /* keep bold */
    padding: 5px 0;     /* optional extra spacing inside link */
    }

    .nav-menu.active{left:0;}
    .nav-menu li{margin:8px 0;}
    .header-cta{display:none;}
    .header-cta .phone-number{ display:none;}
    .header-cta .btn{ padding:-100px; border-radius: 25%;}
    .mobile-toggle{display:block;}
    
    .hero{padding:120px 0 60px !important; margin-top:var(--header-height-mobile) !important; background-attachment:scroll !important;}
    .hero h1{font-size:2.2rem !important;}
    .hero p{font-size:1rem !important; padding:0 10px;}
    
    .services-grid{
        grid-template-columns:1fr !important; 
        gap:20px !important;}
    .service-card{margin-bottom:15px;}
    
    .about-container{flex-direction:column !important; gap:30px !important;}
    .about-text,.about-image{width:100% !important; flex:none !important; transform:none !important;}
    .about-text.animated,.about-image.animated{animation:fadeInUp 0.8s ease forwards !important;}
    
    .contact-container{grid-template-columns:1fr !important; gap:30px !important;}
    .contact-detail{transform:none !important;}
    .contact-detail.animated{animation:fadeInUp 0.5s ease forwards !important;}
    
    .footer-container{grid-template-columns:1fr !important; gap:30px !important; text-align:center;}
    .btn{padding:10px 20px !important; font-size:14px !important;}
    .contact-form input,.contact-form textarea,.contact-form select{font-size:16px !important;}
}
