/* 
   HM Habitat Bâtiment - Main Stylesheet
   Theme: Modern Construction (Dark Gray & Orange)
*/

:root {
    --primary-color: #ff6b00;
    /* Vibrant Construction Orange */
    --secondary-color: #1a1a1a;
    /* Deep Dark Gray / Anthracite */
    --text-color: #333333;
    --light-bg: #f4f4f4;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --transition: all 0.3s ease;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* --- Reset & Global --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Utilities --- */
.text-center {
    text-align: center;
}

.text-white {
    color: var(--white) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-light {
    background-color: var(--light-bg);
}

.bg-dark {
    background-color: var(--secondary-color);
}

.mt-4 {
    margin-top: 1.5rem;
}

.section {
    padding: 80px 0;
}

.section-header {
    margin-bottom: 50px;
}

.section-subtitle {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.section-desc {
    font-size: 1.1rem;
    color: #ccc;
    max-width: 600px;
    margin: 0 auto;
}

.divider {
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin-top: 15px;
}

.divider.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.divider-light {
    background-color: rgba(255, 255, 255, 0.3);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    gap: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.btn-outline-light {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline-light:hover {
    background-color: var(--white);
    color: var(--secondary-color);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1rem;
}

.btn-call-mobile {
    display: none;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.logo-accent {
    color: var(--primary-color);
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

/* --- Hamburger Animation --- */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Hero --- */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    color: var(--white);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Darker overlay for better contrast */
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    /* Increased width to spread text */
    text-align: center;
    /* Ensure text is centered */
    margin-top: 60px;
    /* Push down slightly to balance with header */
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    /* Text shadow for contrast */
    color: var(--white);
    /* Ensure title is white */
    line-height: 1.1;
    /* Tighter line height for better look */
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 1;
    /* Increase opacity */
    max-width: 800px;
    /* Allow subtitle to be wider */
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    color: #f0f0f0;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* --- Header Logo --- */
.logo-img {
    height: 60px;
    width: auto;
}

/* --- Services Grid --- */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.service-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    flex: 1 1 300px;
    max-width: 350px;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-bottom-color: var(--primary-color);
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.service-card p {
    font-size: 0.95rem;
    color: #666;
}

/* --- Service Icons (PNG) --- */

/* --- Service Icons (PNG) --- */
.service-icon-img {
    height: 80px;
    width: auto;
    margin: 0 auto 20px auto;
    /* Centered horizontally */
    object-fit: contain;
    transition: var(--transition);
    display: block;
    /* Ensure block level for margin auto to work */
}

.service-card:hover .service-icon-img {
    transform: scale(1.1);
}

/* --- Projects / Portfolio (Vertical) --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-content: center;
}

.project-card {
    background: var(--black);
    /* Dark background for videos */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    aspect-ratio: 9 / 16;
    /* Enforce vertical aspect ratio */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.project-media-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.project-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    /* Let clicks pass to web-accessible card */
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--white);
    opacity: 0.8;
    transition: var(--transition);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--primary-color);
    opacity: 1;
}

/* --- Why Choose Us --- */
.features-list {
    margin-top: 30px;
}

.features-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 3px;
}

.features-list strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.why-us-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.placeholder-img-lg {
    width: 100%;
    height: 400px;
    background: #ccc url('https://images.unsplash.com/photo-1503387762-592deb58ef4e?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80') center/cover no-repeat;
}

.experience-badge {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.experience-badge .years {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

/* --- Contact Form --- */
.contact-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background-color: #222;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #aaa;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #383838;
}

.form-full {
    grid-column: 1 / -1;
}

.form-note {
    text-align: center;
    margin-top: 15px;
    font-size: 0.8rem;
    color: #777;
}

.btn-block {
    width: 100%;
    display: flex;
}

/* --- Footer --- */
.footer {
    background-color: #111;
    color: #888;
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.footer h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 12px;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--primary-color);
}

/* --- Footer Logo & Social Icons --- */
.footer-logo-img {
    height: 50px;
    width: auto;
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon-link img {
    width: 32px;
    height: 32px;
    transition: var(--transition);
}

.social-icon-link:hover img {
    transform: translateY(-3px);
    filter: drop-shadow(0 0 5px var(--primary-color));
}

/* --- Modal / Lightbox --- */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

#modal-video,
#modal-image {
    max-width: 100%;
    max-height: 90vh;
    /* Keep it within viewport height */
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Contact Confirmation Modal --- */
.modal-confirmation {
    display: none;
    position: fixed;
    z-index: 2002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-confirmation.show {
    display: flex;
    opacity: 1;
}

.modal-confirmation-content {
    background-color: var(--white);
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-confirmation.show .modal-confirmation-content {
    transform: translateY(0);
}

.close-confirmation {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    transition: var(--transition);
}

.close-confirmation:hover {
    color: var(--primary-color);
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirmation-icon svg {
    width: 40px;
    height: 40px;
}

.modal-confirmation-content h3 {
    color: #28a745;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.modal-confirmation-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-close-modal {
    width: 100%;
    padding: 12px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #222;
}

/* --- Back to Top --- */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    pointer-events: none;
}

.scroll-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-to-top:hover {
    background-color: #e65c00;
    transform: translateY(-3px);
}

/* --- Animation Classes --- */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Mobile Responsive --- */
@media (max-width: 992px) {
    .section-title {
        font-size: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 10px;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--white);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        padding: 80px 30px;
        transition: var(--transition);
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 20px;
    }

    .nav-link {
        font-size: 1.2rem;
        color: var(--secondary-color);
    }

    .btn-call-mobile {
        display: inline-block;
        text-align: center;
    }

    .d-none-mobile {
        display: none !important;
    }

    /* Mobile Logo Adjustment */
    .logo-img {
        height: 45px;
        /* Reduced from 60px for mobile */
    }

    .hero-title {
        font-size: 1.8rem;
        /* Reduced from 2.2rem */
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-lg {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .experience-badge {
        bottom: 10px;
        right: 10px;
        padding: 10px;
    }

    .experience-badge .years {
        font-size: 1.5rem;
    }

    /* Center Social Icons on Mobile */
    .social-icons {
        justify-content: center;
    }
}