/* ========================================
   Construction Portfolio Website - Main Styles
   Professional, Clean, and Responsive Design
   ======================================== */

/* ========================================
   CSS Variables & Root Styles
   ======================================== */
:root {
    /* Colors */
    --primary-color: #ff6b35;
    --secondary-color: #004e89;
    --accent-color: #f77f00;
    --dark-color: #1a1a2e;
    --light-color: #f5f5f5;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success-color: #25d366;
    
    /* Typography */
    --font-primary: 'Heebo', 'Rubik', Arial, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Container */
    --container-max-width: 1200px;
    --container-padding: 1rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: var(--line-height-base);
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--dark-color);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Container & Layout
   ======================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-whatsapp {
    background-color: var(--success-color);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    color: var(--white);
}

/* ========================================
   Language Switcher
   ======================================== */
.language-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: none;
    background-color: transparent;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
}

.lang-btn:hover {
    background-color: var(--light-color);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ========================================
   WhatsApp Floating Button
   ======================================== */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: var(--success-color);
    color: var(--white);
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: var(--shadow-xl);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.whatsapp-float:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    color: var(--white);
}

/* ========================================
   Header & Navigation
   ======================================== */
#header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 998;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

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

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    transition: all var(--transition-fast);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    background-image: linear-gradient(rgba(0, 78, 137, 0.85), rgba(255, 107, 53, 0.85)), 
                      url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%23004e89" width="1200" height="600"/><path fill="%23ffffff" fill-opacity="0.05" d="M0 300L100 350L200 250L300 400L400 300L500 350L600 250L700 400L800 300L900 350L1000 250L1100 400L1200 300V600H0Z"/></svg>');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--white);
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: var(--spacing-xl) var(--spacing-md);
}

.hero h1 {
    color: var(--white);
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xl);
    color: rgba(255, 255, 255, 0.95);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   Sections
   ======================================== */
section {
    padding: var(--spacing-xxl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    margin-bottom: var(--spacing-sm);
}

.section-header p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-cta {
    text-align: center;
    margin-top: var(--spacing-xl);
}

/* ========================================
   Services Section
   ======================================== */
.services-preview {
    background-color: var(--light-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: var(--spacing-lg);
}

.service-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
}

.service-card h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--dark-color);
}

.service-card p {
    margin-bottom: 0;
}

/* ========================================
   Portfolio Section
   ======================================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    aspect-ratio: 4/3;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    color: var(--white);
    padding: 2rem 1.5rem;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-overlay h3 {
    color: var(--white);
    margin-bottom: 0.5rem;
}

.portfolio-overlay p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   Why Us Section
   ======================================== */
.why-us {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-color) 100%);
    color: var(--white);
}

.why-us .section-header h2,
.why-us .section-header p {
    color: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    background-color: rgba(255, 107, 53, 0.2);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
}

.feature h3 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
}

.feature p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
}

.cta-content h2 {
    color: var(--white);
    margin-bottom: var(--spacing-md);
}

.cta-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-xl);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
}

.footer-links,
.footer-contact,
.footer-hours {
    list-style: none;
}

.footer-links li,
.footer-contact li,
.footer-hours li {
    margin-bottom: 0.75rem;
}

.footer-links a,
.footer-contact a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-fast);
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--primary-color);
}

.footer-contact i {
    margin-inline-end: 0.5rem;
    color: var(--primary-color);
}

.footer-hours li {
    color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: left var(--transition-normal);
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero {
        min-height: 500px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .language-switcher {
        top: auto;
        bottom: 20px;
        left: 20px;
        padding: 0.25rem;
    }
    
    .lang-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 24px;
    }
    
    .services-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }

    .service-icon,
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .portfolio-item img, 
    .service-image img {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 0.75rem;
    }
    
    section {
        padding: var(--spacing-xl) 0;
    }
    
    .hero {
        min-height: 400px;
    }
    
    .service-card,
    .feature {
        padding: 1.5rem;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.hidden {
    display: none;
}

/* ========================================
   Image Placeholders
   ======================================== */
.portfolio-item img, 
.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 300px;
}

.portfolio-item img[src*="project"],
.service-image img[src*="services"] {
    position: relative;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CSS-only image placeholder fallback */
.portfolio-item img::before,
.service-image img::before {
    content: attr(alt);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    width: 80%;
}

.portfolio-item img::after,
.service-image img::after {
    content: 'Add your image here';
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, 0);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    text-align: center;
}

/* ========================================
   Testimonials & Ratings Section
   ======================================== */
.testimonials-section {
    padding: var(--spacing-xxl) 0;
    background-color: var(--light-color);
}

.rating-summary {
    text-align: center;
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.overall-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.rating-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.rating-stars {
    color: #fbbf24;
    font-size: 1.5rem;
}

.rating-stars i {
    margin: 0 2px;
}

.rating-count {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: var(--spacing-xs);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.testimonial-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.testimonial-avatar {
    font-size: 3rem;
    color: var(--secondary-color);
}

.testimonial-info {
    flex: 1;
}

.testimonial-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--text-dark);
}

.testimonial-stars {
    color: #fbbf24;
    font-size: 0.9rem;
}

.testimonial-text {
    color: var(--text-light);
    line-height: 1.6;
    margin: var(--spacing-sm) 0;
}

.testimonial-date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: var(--spacing-sm);
}

/* Review Form */
.review-form {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin: var(--spacing-xl) 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.review-form h3 {
    margin-bottom: var(--spacing-lg);
    color: var(--text-dark);
    text-align: center;
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: var(--spacing-xs);
    font-size: 2rem;
    direction: ltr;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    color: #ddd;
    transition: color var(--transition-fast);
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #fbbf24;
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-lg);
}

@media (max-width: 768px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ========================================
   Mobile Optimization Overrides (Screens < 768px)
   ======================================== */
@media (max-width: 768px) {
    /* 1. Global Spacing & Typography */
    :root {
        --spacing-xl: 1.5rem;
        --spacing-xxl: 2rem;
        --container-padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero {
        min-height: 400px;
    }

    /* 2. Component Optimization */
    /* Icons */
    .service-icon,
    .feature-icon,
    .service-icon-large {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
        line-height: 50px;
        margin-bottom: 1rem;
    }

    /* Cards */
    .service-card,
    .feature,
    .testimonial-card,
    .additional-card {
        padding: 1.25rem !important;
    }

    /* Portfolio */
    .portfolio-item {
        aspect-ratio: 16/9 !important;
    }

    /* 3. Layout Adjustments */
    /* Services - Image Top, Text Bottom */
    .service-detail,
    .service-detail.reverse {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .service-image {
        order: -1;
        width: 100%;
    }

    .service-content {
        text-align: center;
        width: 100%;
    }

    /* Alignment */
    .service-card,
    .feature,
    .footer-content,
    .additional-card,
    .process-card {
        text-align: center;
    }
    
    .footer-section {
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .footer-links,
    .footer-contact,
    .footer-hours {
        text-align: center;
        padding: 0;
    }

    /* Lists inside service details - Keep aligned to start (RTL/LTR friendly) */
    .service-content ul {
        text-align: start;
        display: inline-block;
        width: 100%;
        max-width: 100%; 
    }
}
