/* TODO: Responsive Design */

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: #f8f9fb;
    color: #333;
    line-height: 1.6;
    zoom: 67%;
}

/* Header - Responsive */
header {
    background-color: #003366;
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    border-bottom: 2px solid #ccc;
    z-index: 500;
}

.menu {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 8px clamp(10px, 3vw, 20px);
    flex-wrap: wrap;
    gap: 15px;
}

.menu ul {
    list-style: none;
    display: flex;
    gap: clamp(10px, 2vw, 25px);
    margin: 0;
    padding: 0;
    /*position: absolute;*/
    /*left: 50%;*/
    /*transform: translateX(-50%);*/
    flex-wrap: wrap;
    justify-content: center;
}

.menu li {
    color: #fff;
    cursor: pointer;
    padding: clamp(8px, 2vw, 10px) clamp(12px, 2vw, 18px);
    border-radius: 5px;
    transition: background 0.3s;
    font-weight: 500;
    font-size: clamp(0.9rem, 2vw, 1rem);
    white-space: nowrap;
}

.menu button {
    margin-left: auto;
    margin-right: 5px;
    background-color: white;
    color: black;
    min-height: 44px;
}

.menu li:hover,
.menu li.active {
    background-color: #0059b3;
}

.container {
    justify-content: center;
    display: flex;
    align-items: center;
    gap: clamp(20px, 5vw, 50px);
    margin-bottom: 5px;
    margin-left: 5px;
    /*margin-right: 50px;*/
    flex-wrap: wrap;
}

/* Style for the buttons container */
.acc-btns {
    display: flex;
    gap: 100px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-right: 5px;
}

.logo {
    width: clamp(80px, 35vw, 100px);
    height: clamp(70px, 28vw, 100px);
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    border-radius: 20px;
}

.title {
    font-size: clamp(1.2rem, 4vw, 1.75rem);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Main content - Responsive */
main {
    padding: clamp(20px, 4vw, 30px) clamp(10px, 3vw, 0px);
    margin-top: 80px;
}

.content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    padding-top: clamp(40px, 15vw, 20px);
}

.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

h1 {
    color: #003366;
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

p {
    text-align: justify;
    line-height: 1.6;
    max-width: min(900px, 90%);
    margin: 0 auto 20px;
    font-size: clamp(1rem, 3vw, 1.5rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sub-section {
    margin: clamp(15px, 3vw, 20px) 0;
}

.service-block {
    margin: clamp(20px, 4vw, 40px) 0;
}

hr {
    border: none;
    height: 1px;
    background-color: #ccc;
    margin: clamp(20px, 4vw, 40px) auto;
    width: min(60%, 90%);
}

/* Hero section - Responsive */
.hero {
    background-image: url('imgs/accueil1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: clamp(250px, 40vw, 400px);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    align-items: center;
    color: white;
    text-align: center;
    font-family: Arial, sans-serif;
}

.hero h1 {
    /* padding-top: clamp(30px, 10vw, 100px); */
    font-size: clamp(2rem, 6vw, 4rem);
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: #002896;
    padding-bottom: 15px;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.6rem);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    background-color: black;
    padding: 10px;
    border-radius: 10px;
    text-wrap: nowrap;
}

p.no-wrap {
    white-space: nowrap;
}

/* Sections - Responsive */
.acc, .prop {
    padding: clamp(50px, 15vw, 150px) clamp(15px, 3vw, 0px);
}

.acc1 {
    padding: clamp(15px, 3vw, 20px) clamp(15px, 3vw, 30px);
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4vw, 30px);
}

.acc1 img {
    width: 100%;
    max-width: 600px;
    border-radius: 10%;
    margin: 0 auto;
    display: block;
}

.team, .experience {
    display: flex;
    flex-wrap: wrap;
    padding: clamp(15px, 3vw, 25px) clamp(10px, 2vw, 15px);
    gap: clamp(12px, 2.5vw, 20px);
    justify-content: center;
}

.team img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    margin-bottom: 12px;
}

.member, .exp {
    border: 2px black solid;
    border-radius: 10px;
    padding: clamp(10px, 2vw, 15px);
    width: min(280px, 100%);
    flex: 1 1 min(280px, 100%);
    margin: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.member:hover, .exp:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.member h5, .exp h5 {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    margin-bottom: 10px;
    color: #666;
    font-weight: 500
}

.member p, .exp p {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    line-height: 1.4;
    margin-bottom: 0;
    color: #444;
}

.member h3, .exp h3 {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 8px;
    color: #003366;
    padding: 0 10px;
    text-align: center;
}

/* Services - Responsive */
.serv {
    padding-top: clamp(30px, 6vw, 50px);
}

.ser {
    display: flex;
    flex-direction: column;
    padding: clamp(20px, 4vw, 30px) clamp(15px, 3vw, 20px);
    gap: clamp(30px, 6vw, 50px);
    align-items: center;
}

.ser img {
    width: min(400px, 90%);
    border-radius: 10%;
    order: -1;
}

.ser1 {
    display: block;
    text-align: center;
}

.ser1 h3 {
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 3rem);
    margin-bottom: 20px;
}

/* Contact - Responsive */
.contact {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4vw, 30px);
    padding: 0 clamp(15px, 3vw, 20px);
}

.contact img {
    width: min(500px, 100%);
    padding: 0;
    border-radius: 10%;
    margin: 0 auto;
    display: block;
}

.cont {
    display: block;
    text-align: center;
}

.co {
    margin-bottom: clamp(30px, 6vw, 50px);
    margin-left: 0;
    text-align: center;
}

.co button {
    padding: clamp(15px, 3vw, 20px) clamp(25px, 5vw, 40px);
    min-height: 44px;
}

#devis:hover {
    background-color: #3e3b3b;
}

.btn {
    display: block;
    margin: 0 auto;
    background-color: white;
    color: black;
    font-size: clamp(1rem, 3vw, 1.125rem);
    padding: clamp(8px, 2vw, 10px) clamp(15px, 3vw, 20px);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
    transition: background-color 0.3s;
}

.btn-dev {
    display: block;
    margin: 0 auto;
    background-color: black;
    color: white;
    font-size: clamp(1rem, 3vw, 1.125rem);
    padding: clamp(8px, 2vw, 10px) clamp(15px, 3vw, 20px);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

/* Modal - Responsive */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: clamp(20px, 4vw, 30px) clamp(15px, 3vw, 20px);
    border-radius: 12px;
    width: min(90%, 500px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideDown 0.4s ease;
    position: relative;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: #888;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    text-align: center;
    color: #000000;
}

.modal-content label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 500;
    color: #555;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: clamp(8px, 2vw, 10px) clamp(10px, 2vw, 12px);
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: clamp(0.8rem, 2vw, 0.875rem);
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

.modal-content input:focus,
.modal-content textarea:focus {
    border-color: #007BFF;
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
    outline: none;
}

.modal-content textarea {
    min-height: 100px;
}

.modal-content button {
    background-color: #007BFF;
    color: white;
    padding: clamp(10px, 2vw, 12px) clamp(15px, 3vw, 20px);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin-top: 20px;
    width: 100%;
    transition: background-color 0.3s;
    min-height: 44px;
}

.modal-content button:hover {
    background-color: #0056b3;
}

#dev {
    color: black;
}

.header-grid {
    display: grid;
    grid-template-columns: auto 1fr auto; /* Logo on left, nav takes remaining space */
    /*align-items: center;*/
    gap: 20px; /* Optional spacing */
}

/* Mobile-first responsive design */
@media (max-width: 1024px) {
    .header-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 10px;
        text-align: center;
        padding: 10px;
    }

    .container {
        justify-content: center;
        margin: 0 auto;
    }

    .acc-btns {
        justify-content: center;
        margin-top: 10px;
    }

    .menu ul {
        position: static;
        transform: none;
        justify-content: center;
        width: 100%;
        margin-top: 10px;
        padding: 10px 0;
    }

    .menu {
        flex-direction: column;
        gap: 10px;
    }

    main {
        padding-top: 300px;
    }
}

@media (max-width: 768px) {
    .acc-btns {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .acc-btns .btn {
        width: 100%;
        max-width: 250px;
    }

    .menu li {
        padding: 8px 12px;
    }

    .menu ul {
        flex-wrap: wrap;
        gap: 8px;
        padding-right: 0 !important;
    }

    main {
        padding-top: 300px;
    }

    .container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .acc1 {
        text-align: center;
    }

    .member, .exp {
        width: calc(50% - 10px);
        min-width: 200px;
        padding: 12px;
        margin: 5px;
    }

    .team img {
        max-height: 500px;
    }

    .ser {
        text-align: center;
    }

    .co {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .header-grid {
        padding: 5px 10px;
    }

    header {
        padding: 3px 0;
    }

    .acc-btns {
        gap: 8px;
    }

    .acc-btns .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .menu {
        padding: 5px 10px;
        margin-top: 200px;
    }

    .menu ul {
        gap: 5px;
    }

    .menu li {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    main {
        padding-top: 300px;
    }

    .hero {
        height: 200px;
    }

    .hero h1 {
        padding-top: 50px;
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 50px;
    }

    .member, .exp {
        width: 100%;
        min-width: auto;
        padding: 10px;
        margin: 8px 0;
    }

    .acc, .prop {
        padding: 30px 0;
    }

    .ser img {
        width: 100%;
    }

    .team img {
        max-height: 150px;
    }

    .team, .experience {
        gap: 10px;
        padding: 10px 5px;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .ser {
        flex-direction: row;
        text-align: left;
    }

    .ser img {
        width: 40%;
        order: 0;
    }

    .contact {
        flex-direction: row;
        align-items: center;
    }

    .contact img {
        width: 45%;
    }

    .member, .exp {
        width: calc(33.333% - 20px);
        min-width: 220px;
    }
}

/* Desktop adjustments */
@media (min-width: 1025px) {
    .ser {
        flex-direction: row;
        text-align: left;
    }

    .ser img {
        width: 30%;
        order: 0;
    }

    .contact {
        flex-direction: row;
        align-items: center;
    }

    .contact img {
        width: 50%;
    }

    .acc1 {
        flex-direction: row;
        text-align: left;
    }

    .acc1 img {
        width: 55%;
        margin: 0;
    }

    .member, .exp {
        width: calc(25% - 20px);
        min-width: 250px;
        max-width: 300px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    #devis:hover,
    .modal-content button:hover {
        transform: none;
    }

    .menu li:hover {
        background-color: transparent;
    }

    .menu li:active {
        background-color: #0059b3;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    }
}

/* Print styles */
@media print {
    header,
    .btn,
    #devis,
    .modal {
        display: none;
    }

    main {
        margin-top: 0;
        padding: 0;
    }

    .content.active {
        padding-top: 0;
    }
}
