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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    font-display: swap; /* Prevent font loading layout shifts */
}

/* Global image optimization */
img {
    max-width: 100%;
    height: auto;
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Global section stability */
section {
    contain: layout style; /* Performance optimization */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    color: #666;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-secondary:hover {
    background-color: #2563eb;
    color: white;
}

/* Header */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand .logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0;
}

.nav-brand .tagline {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0;
}

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

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #2563eb;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
    display: block;
}

/* Hamburger animation */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Header scroll effect */
.header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    background-color: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

/* Form error state */
.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 120px 0 80px;
    margin-top: 80px;
    min-height: 600px; /* Prevent layout shift */
    contain: layout style; /* Performance optimization */
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(400px, auto); /* Prevent row size shifts */
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image img {
    width: 100%;
    height: 400px; /* Fixed height to prevent layout shift */
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Images now loaded - placeholder CSS removed */

/* Services Preview */
.services-preview {
    padding: 80px 0;
    background-color: #f8fafc;
    min-height: 400px; /* Prevent layout shift */
    contain: layout style; /* Performance optimization */
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-template-rows: repeat(auto-fit, minmax(200px, auto)); /* Prevent row size shifts */
    gap: 2rem;
    min-height: 300px; /* Reserve space for service cards */
    contain: layout; /* Performance optimization */
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    text-decoration: none;
    color: inherit;
}

.service-card:visited {
    color: inherit;
}

.service-card:active {
    transform: translateY(-2px);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.service-icon i {
    font-size: 1.5rem;
    color: white;
}

.service-card h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.service-card p {
    color: #64748b;
    line-height: 1.6;
}

/* Why Choose Us */
.why-choose-us {
    padding: 80px 0;
}

.content-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.content-text h2 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 2rem;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.feature h4 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.feature p {
    color: #64748b;
}

.content-image img {
    width: 100%;
    height: 300px; /* Fixed height to prevent layout shift */
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Contact CTA */
.contact-cta {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    padding: 80px 0;
    color: white;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.9);
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.9);
}

.contact-item i {
    font-size: 1.25rem;
}

.contact-cta .btn-primary {
    background-color: white;
    color: #2563eb;
    margin-top: 1rem;
}

.contact-cta .btn-primary:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background-color: #1e293b;
    color: white;
    padding: 60px 0 20px;
}

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

.footer-section h3,
.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section p {
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    color: #94a3b8;
    margin-bottom: 0;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert i {
    font-size: 1.1rem;
}

/* Contact Page Styles */
.page-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 140px 0 80px;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.contact-content {
    padding: 80px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1e293b;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    background-color: white;
    transition: border-color 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #2563eb;
}

/* Map Section */
.map-section {
    margin-top: 4rem;
    text-align: center;
}

.map-section h2 {
    margin-bottom: 2rem;
    color: #1e293b;
}

.map-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.map-placeholder {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.map-placeholder i {
    font-size: 3rem;
    color: #2563eb;
    margin-bottom: 1rem;
}

.map-placeholder h3 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.map-placeholder p {
    color: #64748b;
    margin-bottom: 2rem;
}

.map-links {
    display: flex;
    justify-content: center;
}

.contact-info-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.info-card h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card i {
    color: #2563eb;
}

/* Services Page Styles */
.services-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 140px 0 80px;
    text-align: center;
}

/* Anchor link positioning adjustment */
.service-detail {
    scroll-margin-top: 120px; /* Accounts for fixed header + extra spacing */
}

.services-detailed {
    padding: 80px 0;
}

.service-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
}

.service-detail:nth-child(even) {
    direction: rtl;
}

.service-detail:nth-child(even) > * {
    direction: ltr;
}

.service-detail img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.service-content h3 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.service-features {
    list-style: none;
    margin-top: 1.5rem;
}

.service-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #64748b;
}

.service-features li i {
    color: #22c55e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
        padding: 1rem 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .content-split {
        grid-template-columns: 1fr;
    }

    .contact-info {
        flex-direction: column;
        gap: 1rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .service-detail {
        grid-template-columns: 1fr;
    }

    .service-detail:nth-child(even) {
        direction: ltr;
    }

    .section-title {
        font-size: 2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
    }
}