/* =========================================
   REFERENCES PAGE
   Fresh Hair & Beauty Salon
   Black & Gold Luxury Theme
========================================= */

:root {
    --ref-black: #0d0d0d;
    --ref-dark: #151515;
    --ref-card: #1d1d1d;
    --ref-gold: #c9a45c;
    --ref-gold-light: #e4c985;
    --ref-cream: #f7f2e8;
    --ref-muted: #aaa;
    --ref-border: rgba(201, 164, 92, 0.25);
}

/* =========================================
   HERO SECTION
========================================= */

.references-hero {
    position: relative;
    min-height: 330px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 70px;
    background:
        linear-gradient(
            rgba(10, 10, 10, 0.75),
            rgba(10, 10, 10, 0.9)
        ),
        url("../images/references-hero.jpg") center/cover no-repeat;
    overflow: hidden;
}

.references-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(201, 164, 92, 0.08),
        transparent 60%
    );
    pointer-events: none;
}

.references-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
}

.references-label {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--ref-gold);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.references-hero h1 {
    margin: 0 0 18px;
    color: var(--ref-cream);
    font-family: "Playfair Display", serif;
    font-size: clamp(35px, 5vw, 60px);
    font-weight: 500;
    line-height: 1.2;
}

.references-hero p {
    max-width: 620px;
    margin: 0 auto;
    color: #d0d0d0;
    font-size: 15px;
    line-height: 1.9;
}

/* =========================================
   MAIN PAGE
========================================= */

.references-page {
    min-height: 500px;
    padding: 80px 6%;
    background: var(--ref-black);
}

.references-heading {
    margin-bottom: 40px;
    text-align: center;
}

.references-heading h2 {
    margin: 0 0 15px;
    color: var(--ref-cream);
    font-family: "Playfair Display", serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 500;
}

.references-heading p {
    max-width: 650px;
    margin: 0 auto;
    color: var(--ref-muted);
    font-size: 14px;
    line-height: 1.8;
}

/* =========================================
   FILTER BUTTONS
========================================= */

.references-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 45px;
}

.references-filter-btn {
    padding: 11px 23px;
    border: 1px solid var(--ref-border);
    border-radius: 30px;
    outline: none;
    background: transparent;
    color: #c8c8c8;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition:
        background 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
}

.references-filter-btn:hover {
    border-color: var(--ref-gold);
    color: var(--ref-gold-light);
    transform: translateY(-2px);
}

.references-filter-btn.active {
    border-color: var(--ref-gold);
    background: linear-gradient(
        135deg,
        var(--ref-gold),
        #a77d36
    );
    color: #111;
    font-weight: 600;
}

/* =========================================
   REFERENCES GRID
========================================= */

.references-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   REFERENCE CARD
========================================= */

.reference-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(201, 164, 92, 0.15);
    border-radius: 5px;
    background: var(--ref-card);
    cursor: pointer;
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.reference-card:hover {
    border-color: rgba(201, 164, 92, 0.65);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
    transform: translateY(-7px);
}

.reference-card-image {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #252525;
}

.reference-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.reference-card:hover .reference-card-image img {
    transform: scale(1.06);
}

.reference-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reference-card:hover .reference-card-overlay {
    opacity: 1;
}

.reference-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border: 1px solid var(--ref-gold);
    border-radius: 30px;
    background: rgba(13, 13, 13, 0.85);
    color: var(--ref-gold-light);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.reference-card-content {
    padding: 20px;
}

.reference-card-category {
    display: block;
    margin-bottom: 8px;
    color: var(--ref-gold);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.reference-card-title {
    margin: 0;
    color: var(--ref-cream);
    font-family: "Playfair Display", serif;
    font-size: 21px;
    font-weight: 500;
    line-height: 1.4;
}

.reference-card-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 10px 0 0;
    color: #a9a9a9;
    font-size: 13px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* =========================================
   LOADING STATE
========================================= */

.references-loading {
    padding: 55px 20px;
    text-align: center;
    color: var(--ref-gold);
    font-size: 14px;
}

.references-loading::after {
    content: "";
    display: block;
    width: 28px;
    height: 28px;
    margin: 20px auto 0;
    border: 2px solid rgba(201, 164, 92, 0.2);
    border-top-color: var(--ref-gold);
    border-radius: 50%;
    animation: referencesSpinner 0.8s linear infinite;
}

@keyframes referencesSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   EMPTY STATE
========================================= */

.references-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--ref-muted);
    font-size: 14px;
}

.references-empty i,
.references-empty span {
    display: block;
    margin-bottom: 12px;
    color: var(--ref-gold);
    font-size: 35px;
}

/* =========================================
   MODAL
========================================= */

.reference-modal {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(7px);
}

.reference-modal.active {
    display: flex;
}

.reference-modal-content {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    width: min(1050px, 100%);
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--ref-border);
    border-radius: 6px;
    background: var(--ref-dark);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.65);
    animation: referenceModalShow 0.3s ease;
}

@keyframes referenceModalShow {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reference-modal-media {
    min-height: 350px;
    background: #090909;
}

.reference-modal-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.reference-modal-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 45px;
    overflow-y: auto;
}

.reference-modal-category {
    margin-bottom: 14px;
    color: var(--ref-gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.reference-modal-title {
    margin: 0 0 20px;
    color: var(--ref-cream);
    font-family: "Playfair Display", serif;
    font-size: clamp(25px, 3vw, 38px);
    font-weight: 500;
    line-height: 1.3;
}

.reference-modal-description {
    margin: 0;
    color: #b8b8b8;
    font-size: 14px;
    line-height: 2;
    white-space: pre-line;
}

.reference-modal-close {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(201, 164, 92, 0.5);
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.8);
    color: var(--ref-gold-light);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition:
        background 0.3s ease,
        color 0.3s ease;
}

.reference-modal-close:hover {
    background: var(--ref-gold);
    color: #111;
}

/* =========================================
   HIDDEN CLASS
========================================= */

.references-hidden {
    display: none !important;
}

/* =========================================
   TABLET RESPONSIVE
========================================= */

@media (max-width: 992px) {
    .references-page {
        padding: 65px 4%;
    }

    .references-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .reference-modal-content {
        grid-template-columns: 1fr;
        max-width: 650px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .reference-modal-media {
        min-height: 300px;
        max-height: 450px;
    }

    .reference-modal-media img {
        max-height: 450px;
    }

    .reference-modal-info {
        padding: 30px;
    }
}

/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 600px) {
    .references-hero {
        min-height: 280px;
        padding: 105px 20px 55px;
    }

    .references-label {
        font-size: 10px;
        letter-spacing: 3px;
    }

    .references-hero p {
        font-size: 13px;
    }

    .references-page {
        padding: 50px 18px;
    }

    .references-heading {
        margin-bottom: 30px;
    }

    .references-heading p {
        font-size: 13px;
    }

    .references-filters {
        gap: 8px;
        margin-bottom: 30px;
    }

    .references-filter-btn {
        padding: 9px 14px;
        font-size: 11px;
    }

    .references-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .reference-card-content {
        padding: 13px;
    }

    .reference-card-category {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .reference-card-title {
        font-size: 16px;
    }

    .reference-card-description {
        font-size: 11px;
        line-height: 1.6;
    }

    .reference-view-btn {
        padding: 8px 12px;
        font-size: 9px;
    }

    .reference-modal {
        padding: 15px;
    }

    .reference-modal-content {
        max-height: 92vh;
    }

    .reference-modal-media {
        min-height: 220px;
        max-height: 320px;
    }

    .reference-modal-media img {
        max-height: 320px;
    }

    .reference-modal-info {
        padding: 28px 22px;
    }

    .reference-modal-title {
        font-size: 26px;
    }

    .reference-modal-description {
        font-size: 13px;
        line-height: 1.8;
    }

    .reference-modal-close {
        width: 34px;
        height: 34px;
        font-size: 19px;
    }
}

/* =========================================
   VERY SMALL DEVICES
========================================= */

@media (max-width: 380px) {
    .references-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .reference-card-image {
        aspect-ratio: 5 / 4;
    }

    .references-filter-btn {
        padding: 8px 11px;
    }
}

/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {
    .reference-card,
    .reference-card-image img,
    .references-filter-btn,
    .reference-modal-close {
        transition: none;
    }

    .references-loading::after,
    .reference-modal-content {
        animation: none;
    }
}

/* =========================================
   MODAL MEDIA FIX
========================================= */

.reference-modal-media {
    min-width: 0;
    min-height: 350px;
    overflow: hidden;
    background: #080808;
}

.reference-modal-media img,
.reference-modal-media video {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 350px;
    max-height: 90vh;
    object-fit: contain;
    background: #080808;
}

.reference-modal-info {
    min-width: 0;
    padding: 40px;
}

@media (max-width: 992px) {
    .reference-modal-media {
        min-height: 280px;
    }

    .reference-modal-media img,
    .reference-modal-media video {
        min-height: 280px;
    }
}

/* =========================================
   VIDEO CARD FIX
========================================= */

.reference-card-image video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
}

.reference-card-image video::-webkit-media-controls {
    display: none !important;
}

.reference-card-image video::-webkit-media-controls-enclosure {
    display: none !important;
}

#referenceModalVideo {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 350px;
    max-height: 90vh;
    object-fit: contain;
    background: #000;
}

/* =========================================
   MODAL MEDIA DISPLAY FIX
========================================= */

.reference-modal-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 350px;
    overflow: hidden;
    background: #080808;
}

.reference-modal-media img,
.reference-modal-media video {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 350px;
    max-height: 90vh;
    object-fit: contain;
    background: #080808;
}

@media (max-width: 992px) {
    .reference-modal-media {
        min-height: 280px;
    }

    .reference-modal-media img,
    .reference-modal-media video {
        min-height: 280px;
    }
}