/* ===== file: /assets/css/main.css ===== */
:root {
    /* 🎨 Thème clair attirant (teal de marque) */
    --bg: #f0fdfa;
    --surface: rgba(255, 255, 255, .78);
    --surface2: rgba(255, 255, 255, .92);

    --text: #0f172a;
    --muted: #475569;

    --border: rgba(15, 23, 42, .12);

    --primary: #2563eb;
    --primary2: #06b6d4;

    --shadow: 0 18px 44px rgba(2, 6, 23, .12);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

    /* ✅ Background clair, propre, pro */
    background:
        radial-gradient(1100px 650px at 10% 10%, rgba(20, 184, 166, .14), transparent 60%),
        radial-gradient(1100px 650px at 90% 20%, rgba(45, 212, 191, .12), transparent 60%),
        radial-gradient(900px 520px at 50% 110%, rgba(13, 148, 136, .10), transparent 60%),
        var(--bg);

    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.page {
    padding: 28px 0 60px;
}

.muted {
    color: var(--muted);
}

/* =========================
   Buttons (global)
   (Navbar buttons are styled in navbar.css)
========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    transition: .2s ease;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    border: none;
    color: #ffffff;
    font-weight: 800;
}

.btn.ghost {
    background: transparent;
}

.btn.full {
    width: 100%;
    margin-top: 10px;
}

.btn.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* =========================
   Admin previews (cover / gallery)
========================= */
.cover-preview {
    margin-top: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    position: relative;
}

.cover-preview img {
    width: 180px;
    height: 130px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
    display: block;
}

/* Success badge overlaid on cover photo */
.cover-upload-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(34, 197, 94, 0.92);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    display: none;
    white-space: nowrap;
}

.cover-upload-badge:not(:empty) {
    display: inline-block;
}

.btn-cover-delete {
    margin-top: 2px;
}

/* Gallery upload badge */
.gallery-upload-badge {
    display: none;
    margin-top: 6px;
    background: rgba(34, 197, 94, 0.92);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
    white-space: nowrap;
}

.gallery-upload-badge:not(:empty) {
    display: inline-block;
}

.gallery-admin-preview {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-admin-item {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.gallery-admin-item img {
    width: 130px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
}

.btn-gallery-delete {
    border-color: rgba(248, 113, 113, 0.9);
    color: #b91c1c;
}

.btn-gallery-delete:hover {
    background: rgba(248, 113, 113, 0.12);
}

/* =========================
   Grids
========================= */
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Hero
========================= */
.hero {
    padding: 26px 0 34px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 18px;
    align-items: start;
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
}

.hero h1 {
    font-size: 40px;
    line-height: 1.1;
    margin: 10px 0;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.hero-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

/* Stats */
.stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.stat {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    min-width: 120px;
    box-shadow: var(--shadow);
}

.stat b {
    font-size: 20px;
    display: block;
}

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.h2 {
    margin: 0;
}

/* =========================
   Details
========================= */
.details {
    margin-top: 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
}

.details .heroimg {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.details .meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(37, 99, 235, .08);
    color: var(--muted);
}

/* Pills & notices */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(6, 182, 212, .14);
    color: var(--text);
    font-weight: 800;
    width: fit-content;
}

.notice {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    box-shadow: var(--shadow);
}

/* Sections */
.section {
    padding: 26px 0;
}

.section-head {
    margin-bottom: 12px;
}

.section-title {
    margin: 0 0 6px;
    font-size: 26px;
}

/* Feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

.feature {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface2);
    box-shadow: var(--shadow);
}

.feature-ic {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(37, 99, 235, .10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 900px) {
    .steps {
        grid-template-columns: 1fr;
    }
}

.step {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface2);
    box-shadow: var(--shadow);
}

.step-n {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, .16);
    border: 1px solid var(--border);
    font-weight: 900;
}

/* ========= Galerie de photos ========= */
.prop-gallery {
    margin-top: 18px;
}

.prop-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.prop-gallery-grid .gallery-item {
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.prop-gallery-grid img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}

.prop-gallery-grid img:hover {
    transform: scale(1.03);
}

/* ===== Lightbox ===== */
.gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
}

.gallery-overlay.open {
    display: flex;
}

.gallery-overlay__content {
    position: relative;
    width: min(1000px, 96%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #020617;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.75);
}

.gallery-main-img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.7);
    color: #f9fafb;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-arrow--prev {
    left: 12px;
}

.gallery-arrow--next {
    right: 12px;
}

.gallery-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.85);
    color: #f9fafb;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.gallery-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #020617;
    color: #e5e7eb;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    flex-wrap: wrap;
}

.gallery-counter {
    font-size: 13px;
    opacity: 0.8;
    white-space: nowrap;
}

.gallery-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
}

.gallery-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

.gallery-thumb img {
    display: block;
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: inherit;
}

.gallery-thumb.is-active {
    border-color: #38bdf8;
}

@media (max-width: 640px) {
    .gallery-main-img {
        max-height: 60vh;
    }

    .gallery-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-thumbs {
        width: 100%;
        justify-content: center;
    }
}

/* =========================
   Badge "nouveau" sur lien طلبات التواصل
========================= */
#navContactRequests {
    position: relative;
}

#navContactRequests::after {
    content: "";
    position: absolute;
    top: 6px;
    inset-inline-start: 8px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f97316;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.35);
    transform: scale(0);
    opacity: 0;
    transition: transform .18s ease-out, opacity .18s ease-out;
}

#navContactRequests.has-new::after {
    transform: scale(1);
    opacity: 1;
}

/* =========================
   Toast notifications (admin)
========================= */
.admin-toast-container {
    position: fixed;
    inset-inline-start: 16px;
    bottom: 16px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-toast {
    min-width: 260px;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 16px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    border-inline-start: 4px solid #16a34a;
    font-size: 14px;
}

.admin-toast__title {
    font-weight: 800;
    margin-bottom: 4px;
}

.admin-toast__body {
    font-size: 13px;
    opacity: 0.9;
}

.admin-toast__meta {
    margin-top: 6px;
    font-size: 11px;
    color: #6b7280;
}