/* Layout - Main Page Structure */

/* Body and HTML */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    padding-top: 0;
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 100%;
}

/* Main Layout Container */
.main-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding-top: 0;
}

/* Section Spacing */
.section {
    padding: var(--section-padding) 0;
    position: relative;
}

.section-sm {
    padding: calc(var(--section-padding) * 0.6) 0;
}

.section-lg {
    padding: calc(var(--section-padding) * 1.4) 0;
}

.section-xl {
    padding: calc(var(--section-padding) * 1.8) 0;
}

/* Container Modifications */
.container-fluid {
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #00AEEF 0%, #003366 100%);
    color: white;
    padding: 1.5rem 0 1rem 0;
    min-height: calc(100vh - 50px);
    min-height: calc(100svh - 50px);
    display: flex;
    align-items: center;
    position: relative;
    margin-top: -20px; /* Pull hero closer to header */
    padding-top: calc(1.5rem + 20px); /* Compensate for negative margin */
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    color: white;
}

.hero-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    max-width: 85%;
    line-height: 1.5;
}

/* Hero Button Styles */
.hero .btn-primary-custom {
    margin-top: 0.5rem;
    padding: 14px 30px;
    font-size: 0.9rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 10;
    position: relative;
    display: inline-block;
}

/* Force override conflicting styles */
.hero .hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem) !important;
    margin-bottom: 1.2rem !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.8) !important;
}

.hero .hero-content p {
    font-size: clamp(1.1rem, 2vw, 1.3rem) !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.98) !important;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.7) !important;
}

/* Override all hero padding conflicts - FINAL FIX */
section.hero,
#home.hero,
.hero,
section#home {
    padding: 0 !important;
    padding-top: 20px !important;
    padding-bottom: 0 !important;
    margin-top: -20px !important;
    margin-bottom: 0 !important;
    min-height: calc(100vh - 50px) !important;
    min-height: calc(100svh - 50px) !important;
    height: auto !important;
}

/* Remove any extra spacing from Bootstrap containers in hero */
.hero .container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    max-width: 100% !important;
}

.hero .row {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure hero extends to bottom of viewport */
.hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient);
}

/* Ensure section class doesn't override hero */
section.hero.section,
#home.section {
    padding: 0 !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* Final override for hero text visibility */
.hero h1,
.hero .hero-content h1,
section.hero h1,
#home h1 {
    color: #ffffff !important;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6) !important;
    filter: contrast(1.2) brightness(1.1) !important;
}

.hero p,
.hero .hero-content p {
    color: rgba(255, 255, 255, 0.98) !important;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.7) !important;
}

.hero-decoration i {
    color: rgba(255, 255, 255, 0.2) !important;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3) !important;
}

/* Remove any gaps after hero section */
.hero + section,
#home + section {
    margin-top: 0 !important;
    padding-top: 4rem !important;
}

/* Responsive overrides */
@media (max-width: 767.98px) {
    section.hero,
    #home.hero,
    .hero,
    section#home {
        padding: 0 !important;
        padding-top: 15px !important;
        padding-bottom: 0 !important;
        margin-top: -15px !important;
        margin-bottom: 0 !important;
        min-height: calc(100vh - 45px) !important;
        min-height: calc(100svh - 45px) !important;
        height: auto !important;
    }
}

@media (max-width: 575.98px) {
    section.hero,
    #home.hero,
    .hero,
    section#home {
        padding: 0 !important;
        padding-top: 10px !important;
        padding-bottom: 0 !important;
        margin-top: -10px !important;
        margin-bottom: 0 !important;
        min-height: calc(100vh - 40px) !important;
        min-height: calc(100svh - 40px) !important;
        height: auto !important;
    }
}

/* Services Section */
.services {
    padding: 5rem 0;
    background: #f8f9fa;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    height: 100%;
    transition: transform 0.3s ease;
    border: 1px solid #e9ecef;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Contact Form Section */
.contact-form {
    padding: 5rem 0;
    background: white;
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* About Section */
.about {
    padding: 5rem 0;
    background: white;
}

.about-content {
    font-size: 1.1rem;
    line-height: 1.7;
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.about-decoration {
    font-size: 8rem;
    color: var(--primary-color);
    opacity: 0.1;
}

/* Statistics Section */
.statistics {
    padding: 5rem 0;
    background: #f8f9fa;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    height: 100%;
}

.stat-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Differentials Section */
.diferentials {
    padding: 5rem 0;
    background: white;
}

.differential-card {
    display: flex;
    align-items: flex-start;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    height: 100%;
    transition: transform 0.3s ease;
}

.differential-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.differential-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.differential-content h4 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.differential-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    text-align: center;
    opacity: 0.8;
    color: var(--text-secondary);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: 1;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-light);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.content-section.dark {
    background: var(--dark-bg);
    color: white;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

/* Responsive Grid */
@media (max-width: 991.98px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 767.98px) {
    .hero {
        min-height: calc(100vh - 45px);
        min-height: calc(100svh - 45px);
        padding: 1rem 0 0.8rem 0;
        margin-top: -15px;
        padding-top: calc(1rem + 15px);
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 0.6rem;
    }
    
    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
    
    .content-section {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-md);
    }
}

@media (max-width: 575.98px) {
    .section {
        padding: calc(var(--section-padding) * 0.6) 0;
    }
    
    .content-section {
        padding: var(--spacing-md);
        border-radius: var(--border-radius-md);
    }
    
    .hero {
        min-height: calc(100vh - 40px);
        min-height: calc(100svh - 40px);
        padding: 1rem 0 0.8rem 0;
        margin-top: -10px;
        padding-top: calc(1rem + 10px);
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        line-height: 1.1;
    }
    
    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }
    
    .hero .btn-primary-custom {
        padding: 12px 25px;
        font-size: 0.85rem;
        margin-top: 0.3rem;
    }
    
    .hero .hero-content h1 {
        font-size: 2rem !important;
        text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.8) !important;
    }
    
    .hero .hero-content p {
        font-size: 1rem !important;
        text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.7) !important;
    }
}

/* Scroll Offset for Fixed Header */
.scroll-offset {
    scroll-margin-top: 100px;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

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

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }
.p-0 { padding: 0; }

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link */
.skip-link {
    position: fixed;
    top: 6px;
    left: 6px;
    background: var(--action-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 2000;
    transform: translateY(calc(-100% - 12px));
    transition: transform 0.3s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
}
