/* ===========================
   DYNASTY 8 — REAL ESTATE
   Dark Theme Stylesheet
   =========================== */

/* — Reset & Base — */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-card: #222222;
    --bg-card-hover: #2a2a2a;
    --bg-input: #2a2a2a;
    --bg-header: rgba(13, 13, 13, 0.92);

    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666;

    --accent-blue: #4a90d9;
    --accent-green: #4caf50;
    --accent-green-light: #66ff66;
    --accent-red: #e74c3c;
    --accent-orange: #ff9800;
    --accent-teal: #26a69a;

    --badge-id-bg: #2563eb;
    --badge-type-bg: #16a34a;
    --badge-type-text: #fff;

    --border-color: #333;
    --border-radius: 10px;
    --border-radius-sm: 6px;

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-header: 0 2px 20px rgba(0, 0, 0, 0.5);

    --transition-fast: 0.2s ease;
    --transition-medium: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    --max-width: 1300px;
    --header-height: 64px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* — HEADER — */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-header);
    transition: background var(--transition-medium);
}

.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 2px;
    transition: opacity var(--transition-fast);
}

.header__logo:hover {
    opacity: 0.8;
}

.header__logo-icon {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.header__logo-text {
    color: var(--text-primary);
}

.header__logo-accent {
    color: var(--accent-green);
    font-size: 1.6rem;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* — BUTTONS — */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn--outline {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn--outline:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn--primary {
    background: var(--accent-green);
    color: #fff;
}

.btn--primary:hover {
    background: #43a047;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

/* — HERO BANNER — */
.hero {
    position: relative;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: url('/assets/banner.png') center center / cover no-repeat;
    margin-top: var(--header-height);
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(13, 13, 13, 0.3) 0%,
            rgba(13, 13, 13, 0.5) 50%,
            rgba(13, 13, 13, 0.95) 100%);
}

.hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: heroFadeIn 1s ease-out;
}

.hero__logo-img {
    width: 320px;
    height: 250px;
    margin: 0 auto 16px;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5));
    opacity: 0.85;
}

.hero__title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 8px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

.hero__title span {
    color: var(--accent-green);
}

.hero__subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 3px;
    margin-top: 8px;
    text-transform: uppercase;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* — FILTERS — */
.filters {
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.filters__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filters__search {
    position: relative;
}

.filters__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.filters__search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filters__search-input::placeholder {
    color: var(--text-muted);
}

.filters__search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.filters__dropdowns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-group {
    flex: 1;
    min-width: 140px;
}

.filter-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--accent-blue);
}

.filter-select--highlight {
    border-color: var(--accent-green);
}

/* — PROPERTIES GRID — */
.properties {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 24px;
    min-height: 60vh;
}

.properties__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.properties__loading,
.properties__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
    gap: 16px;
}

/* — SPINNER — */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* — PROPERTY CARD — */
.property-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
    display: flex;
    flex-direction: column;
    animation: cardFadeIn 0.4s ease-out both;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.property-card__image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    cursor: pointer;
}

/* — Card Carousel — */
.card-carousel__track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-carousel__slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
}

.card-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 5;
    backdrop-filter: blur(4px);
}

.property-card__image-wrapper:hover .card-carousel__nav {
    opacity: 1;
}

.card-carousel__nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.card-carousel__nav--prev {
    left: 8px;
}

.card-carousel__nav--next {
    right: 8px;
}

.card-carousel__dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 5;
}

.card-carousel__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.card-carousel__dot--active {
    background: #fff;
    transform: scale(1.3);
}

.property-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-medium);
}

.property-card__image-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    z-index: 5;
}

.property-card__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.property-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    color: var(--text-primary);
}

.property-card__badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge--id {
    background: var(--badge-id-bg);
    color: #fff;
}

.badge--type {
    background: var(--badge-type-bg);
    color: var(--badge-type-text);
}

.badge--vente {
    background: #e11d48;
    color: #fff;
}

.badge--location {
    background: #0891b2;
    color: #fff;
}

.badge--garage {
    background: #7c3aed;
    color: #fff;
}

/* .property-card__description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
} */

.property-card__description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;

    /* On ajoute une hauteur fixe et un scroll */
    max-height: 90px;
    /* Environ 4 ou 5 lignes */
    overflow-y: auto;
    /* Fait apparaître une barre de défilement si besoin */
    padding-right: 8px;
    /* Évite que le texte ne touche la barre de défilement */
}

/* — SCROLLBAR PERSONNALISÉE POUR LA DESCRIPTION — */
.property-card__description::-webkit-scrollbar {
    width: 4px;
}

.property-card__description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.property-card__description::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 4px;
}

.property-card__description::-webkit-scrollbar-thumb:hover {
    background: #43a047;
}

/* — SPECS TABLE — */
.property-card__specs {
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-bottom: 16px;
    margin-top: auto;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.82rem;
}

.spec-row__label {
    color: var(--text-secondary);
}

.spec-row__value {
    color: var(--text-primary);
    font-weight: 500;
}

.spec-row__value--green {
    color: var(--accent-green-light);
    font-weight: 600;
}

.spec-row__value--red {
    color: var(--accent-red);
    font-weight: 600;
}

.spec-row__value--orange {
    color: var(--accent-orange);
    font-weight: 600;
}

/* — PRICE — */
.property-card__price-section {
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.property-card__price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-green);
}

.property-card__old-price {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* — CARD ACTION — */
.property-card__action {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, var(--accent-green), var(--accent-teal));
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.property-card__action:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

/* — PAGINATION — */
.pagination {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 24px 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination__btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.pagination__btn--active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #fff;
    font-weight: 600;
}

.pagination__btn--disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* — BACK TO TOP — */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-medium);
    z-index: 800;
    box-shadow: var(--shadow-card);
}

.back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

/* — FOOTER — */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.footer__copyright {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.footer__disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* — MODAL — */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay--active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.modal__close {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.modal__close:hover {
    opacity: 1;
}

.modal__gallery {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal__image {
    max-width: 80vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--border-radius);
    transition: opacity 0.3s ease;
}

.modal__video {
    width: 80vw;
    height: 75vh;
    border: none;
    border-radius: var(--border-radius);
    background: #000;
}

.modal__nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal__nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal__dots {
    display: flex;
    gap: 8px;
}

.modal__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.modal__dot--active {
    background: var(--accent-green);
}

/* — NO IMAGE PLACEHOLDER — */
.property-card__no-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* — RESPONSIVE — */
@media (max-width: 1024px) {
    .properties__grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .hero {
        height: 300px;
    }

    .hero__title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero {
        height: 250px;
    }

    .hero__title {
        font-size: 2rem;
        letter-spacing: 4px;
    }

    .hero__logo-img {
        width: 80px;
        height: 80px;
    }

    .hero__subtitle {
        font-size: 0.85rem;
    }

    .filters__dropdowns {
        gap: 6px;
    }

    .filter-group {
        min-width: 120px;
    }

    .properties__grid {
        grid-template-columns: 1fr;
    }

    .header__logo {
        font-size: 1.1rem;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .modal__image {
        max-width: 95vw;
    }

    .modal__nav {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .properties {
        padding: 16px 12px;
    }

    .filters__inner {
        padding: 0 12px;
    }

    .header__inner {
        padding: 0 12px;
    }

    .property-card__body {
        padding: 14px;
    }
}