﻿/* =============================================================
   ClikSell — Projects Browse Page
   Path: wwwroot/css/Explore/Projects.css
   Tokens mirror LandingPage.css — same design system
   ============================================================= */

:root {
    --ink: #0D1117;
    --ink-soft: #4B5563;
    --ink-faint: #9CA3AF;
    --gold: #C8A951;
    --gold-light: #E8D49A;
    --teal: #165B75;
    --teal-light: #1E7A9A;
    --surface: #FFFFFF;
    --off: #F8F7F4;
    --border: rgba(13,17,23,0.09);
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', sans-serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-sm: 0 2px 12px rgba(13,17,23,0.06);
    --shadow-md: 0 8px 32px rgba(13,17,23,0.10);
    --shadow-lg: 0 24px 64px rgba(13,17,23,0.13);
    --toolbar-h: 64px;
}

/* =============================================================
   PAGE SHELL
   ============================================================= */
.projects-page {
    display: block;
    padding-top:90px;
    width: 100%;
    min-height: 100vh;
    background: var(--off);
    font-family: var(--font-body);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* Override app.css shell constraints when projects page is active.
   .content has position:absolute, left:var(--sidebar-collapsed),
   width:calc(100% - sidebar) — all wrong for a full-width client page. */
.content:has(.projects-page) {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh;
    overflow-y: visible !important;
}

.layout-shell:has(.projects-page) {
    height: auto !important;
    overflow: visible !important;
}

/* =============================================================
   LOADING
   ============================================================= */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1.25rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================
   TOOLBAR
   ============================================================= */
.toolbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(248,247,244,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 clamp(1rem, 3vw, 2.5rem);
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: var(--toolbar-h);
    max-width: 1600px;
    margin: 0 auto;
}

/* Search box */
.searchbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0 1rem;
    height: 40px;
    flex: 1;
    max-width: 380px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .searchbox:focus-within {
        border-color: var(--teal);
        box-shadow: 0 0 0 3px rgba(22,91,117,0.08);
    }

    .searchbox i {
        color: var(--ink-faint);
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .searchbox input {
        border: none;
        outline: none;
        background: none;
        font-family: var(--font-body);
        font-size: 0.875rem;
        color: var(--ink);
        width: 100%;
    }

        .searchbox input::placeholder {
            color: var(--ink-faint);
        }

.clearbtn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-faint);
    font-size: 0.8rem;
    padding: 2px;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

    .clearbtn:hover {
        color: var(--ink);
    }

/* Filter pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 40px;
    padding: 0 1.1rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

    .pill:hover {
        border-color: var(--ink-soft);
        color: var(--ink);
    }

    .pill.ghost {
        background: transparent;
        border-color: var(--border);
    }

    .pill.active {
        background: var(--ink);
        color: #fff;
        border-color: var(--ink);
    }

    .pill i {
        font-size: 0.75rem;
    }

/* Brand chips row */
.toolbar-row.chips {
    height: 48px;
    gap: 0.5rem;
    border-top: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

    .toolbar-row.chips::-webkit-scrollbar {
        display: none;
    }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 32px;
    padding: 0 0.9rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .chip img {
        width: 18px;
        height: 18px;
        object-fit: contain;
        border-radius: 2px;
    }

    .chip:hover {
        border-color: var(--teal);
        color: var(--teal);
    }

    .chip.active {
        background: var(--ink);
        color: #fff;
        border-color: var(--ink);
    }

    .chip.skeleton {
        width: 80px;
        background: var(--border);
        border-color: transparent;
        animation: shimmer 1.4s infinite;
    }

@keyframes shimmer {
    0%,100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.9;
    }
}

/* Overlay + Popover */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: transparent;
}

.popover {
    position: absolute;
    top: calc(100% + 6px);
    left: clamp(1rem, 3vw, 2.5rem);
    z-index: 60;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 300px;
    animation: popIn 0.18s var(--ease-out);
}

    .popover.wide {
        width: 420px;
    }

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.popover-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.xbtn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-faint);
    font-size: 0.9rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition: background 0.2s, color 0.2s;
}

    .xbtn:hover {
        background: var(--off);
        color: var(--ink);
    }

.popover-body {
    padding: 1rem 1.25rem 1.25rem;
}

.fieldrow {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

    .fieldrow label {
        font-size: 0.78rem;
        font-weight: 500;
        color: var(--ink-soft);
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .fieldrow input,
    .fieldrow select {
        height: 40px;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 0 0.85rem;
        font-family: var(--font-body);
        font-size: 0.875rem;
        color: var(--ink);
        background: var(--off);
        outline: none;
        transition: border-color 0.2s;
    }

        .fieldrow input:focus,
        .fieldrow select:focus {
            border-color: var(--teal);
        }

.chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chipbtn {
    height: 34px;
    padding: 0 1rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--off);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.2s;
}

    .chipbtn:hover {
        border-color: var(--teal);
        color: var(--teal);
    }

    .chipbtn.active {
        background: var(--ink);
        color: #fff;
        border-color: var(--ink);
    }

.actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.btn {
    height: 38px;
    padding: 0 1.2rem;
    border-radius: 100px;
    border: none;
    background: var(--ink);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn:hover {
        background: var(--teal);
    }

    .btn.ghost {
        background: var(--off);
        color: var(--ink-soft);
        border: 1px solid var(--border);
    }

        .btn.ghost:hover {
            color: var(--ink);
            border-color: var(--ink-soft);
        }

/* =============================================================
   RESULTS HEADER
   ============================================================= */
.results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem clamp(1rem, 3vw, 2.5rem);
    max-width: 1600px;
    margin: 0 auto;
    gap: 1rem;
    flex-wrap: wrap;
}

.count {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
}

.right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort {
    height: 36px;
    padding: 0 0.85rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--ink-soft);
    background: var(--surface);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

    .sort:focus {
        border-color: var(--teal);
    }

.view-toggles {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
}

.iconbtn {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    border-radius: 7px;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    color: var(--ink-faint);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

    .iconbtn:hover {
        color: var(--ink);
    }

    .iconbtn.active {
        background: var(--ink);
        color: #fff;
    }

/* =============================================================
   CONTENT AREA (grid / split / map)
   ============================================================= */
.results-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2.5rem) 4rem;
}

/* List pane */
.list-pane {
    width: 100%;
}

/* Map pane — hidden in grid mode */
.map-pane {
    display: none;
}

/* SPLIT mode */
.results-content.split {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 1.5rem;
    align-items: start;
    padding-bottom: 0;
}

    .results-content.split .list-pane {
        max-height: calc(100vh - var(--toolbar-h) - 60px);
        overflow-y: auto;
        scrollbar-width: thin;
        padding-bottom: 2rem;
    }

    .results-content.split .map-pane {
        display: block;
        position: sticky;
        top: calc(var(--toolbar-h) + 60px);
        height: calc(100vh - var(--toolbar-h) - 80px);
        border-radius: 20px;
        overflow: hidden;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }

/* MAP mode */
.results-content.map .list-pane {
    display: none;
}

.results-content.map .map-pane {
    display: block;
    height: calc(100vh - var(--toolbar-h) - 60px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* =============================================================
   PROJECTS GRID
   ============================================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0 2rem;
}

/* =============================================================
   PROJECT CARD
   ============================================================= */
.card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out), border-color 0.2s;
    display: flex;
    flex-direction: column;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
        border-color: rgba(22,91,117,0.18);
    }

/* Media / image area */
.media {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--off);
    flex-shrink: 0;
}

/* Carousel */
.carousel {
    display: flex;
    width: 100%;
    height: 100%;
    transform: translateX(calc(var(--i, 0) * -100%));
    transition: transform 0.38s var(--ease-out);
}

    .carousel img {
        min-width: 100%;
        height: 100%;
        object-fit: cover;
        flex-shrink: 0;
        display: block;
    }

/* Badge */
.badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    background: rgba(13,17,23,0.7);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.65rem;
    border-radius: 100px;
}

/* Heart / save */
.heart {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

    .heart:hover {
        background: #fff;
        color: #e53e3e;
        transform: scale(1.1);
    }

    .heart .fa-solid {
        color: #e53e3e;
    }

/* Carousel nav arrows */
.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    color: var(--ink);
    font-size: 0.7rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.media:hover .nav {
    opacity: 1;
}

.prev {
    left: 0.6rem;
}

.next {
    right: 0.6rem;
}

.nav:hover {
    background: #fff;
}

/* Dots */
.dots {
    position: absolute;
    bottom: 0.65rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 3;
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    transition: background 0.2s, transform 0.2s;
}

    .dot.active {
        background: #fff;
        transform: scale(1.3);
    }

/* Card body */
.body {
    padding: 1.1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
    margin: 0;
    flex: 1;
}

.price {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--teal);
    white-space: nowrap;
    padding: 0.25rem 0.65rem;
    background: rgba(22,91,117,0.07);
    border-radius: 100px;
    flex-shrink: 0;
}

.loc {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

    .loc i {
        color: var(--gold);
        font-size: 0.75rem;
    }

.stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

    .stats span {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.78rem;
        color: var(--ink-soft);
    }

    .stats i {
        color: var(--ink-faint);
        font-size: 0.7rem;
    }

/* =============================================================
   EMPTY STATE
   ============================================================= */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 6rem 2rem;
    text-align: center;
    color: var(--ink-soft);
}

    .empty-state i {
        font-size: 3rem;
        color: var(--ink-faint);
    }

    .empty-state h3 {
        font-family: var(--font-display);
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--ink);
        margin: 0;
    }

    .empty-state p {
        font-size: 0.95rem;
        font-weight: 300;
        margin: 0;
    }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1100px) {
    .results-content.split {
        grid-template-columns: 1fr 380px;
    }
}

@media (max-width: 900px) {
    .results-content.split {
        grid-template-columns: 1fr;
    }

        .results-content.split .map-pane {
            display: none;
        }

        .results-content.split .list-pane {
            max-height: none;
            overflow: visible;
        }
}

@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .toolbar-row {
        gap: 0.4rem;
    }

    .searchbox {
        max-width: none;
    }

    .pill span {
        display: none;
    }
}
