/* =========================================================
   THE PURPLE LIBRARY — PUBLIC SHELVES
========================================================= */

:root{
    --shelves-bg:#160b31;
    --shelves-panel:#32185b;
    --shelves-purple:#5e2a7e;
    --shelves-lavender:#cfa9ff;
    --shelves-paper:#fbfaff;
    --shelves-text:#171224;
    --shelves-muted:#8f82a6;
    --shelves-accent:#ff4fa0;
    --shelves-border:rgba(255,255,255,.12);
    --shelves-shadow:0 28px 90px rgba(0,0,0,.34);
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    min-height:100vh;
    font-family:Inter,sans-serif;
    color:white;
    background:
        radial-gradient(circle at top,#6c3aa0 0%,#241246 46%,#12091f 100%);
}

/* =========================================================
   NAV
========================================================= */

.shelves-site-header{
    position:sticky;
    top:0;
    z-index:20;

    min-height:76px;

    display:grid;
    grid-template-columns:auto 1fr auto;
    align-items:center;
    gap:28px;

    padding:0 42px;

    background:#2d1658;
    border-bottom:1px solid rgba(255,255,255,.08);
    box-shadow:0 10px 30px rgba(0,0,0,.16);
}

.shelves-brand{
    display:flex;
    align-items:center;
    gap:14px;

    color:white;
    text-decoration:none;
}

.shelves-brand-dot{
    width:18px;
    height:18px;

    border-radius:50%;

    background:#ff4fa0;
    box-shadow:0 0 18px rgba(255,79,160,.45);
}

.shelves-brand-name{
    color:white;

    font-size:29px;
    font-weight:900;
    letter-spacing:-.04em;
    line-height:1;
}

.shelves-nav{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:30px;
}

.shelves-nav a{
    color:white;
    text-decoration:none;

    font-size:15px;
    font-weight:900;

    transition:.2s ease;
}

.shelves-nav a:hover,
.shelves-nav a.active{
    color:#ff4fa0;
}

.shelves-add-story-link{
    min-height:44px;

    display:inline-flex;
    align-items:center;
    gap:7px;

    padding:0 24px;

    border:1px solid rgba(207,169,255,.42);
    border-radius:999px;

    background:rgba(255,255,255,.06);
    color:#ff4fa0 !important;
}

.shelves-auth{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:18px;
}

.shelves-login-link,
.shelves-signup-link,
.shelves-profile-link{
    color:white;
    text-decoration:none;

    font-size:15px;
    font-weight:900;
}

.shelves-signup-link{
    min-height:48px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:0 26px;

    border-radius:999px;

    background:#ff4fa0;
    color:white;

    box-shadow:0 12px 28px rgba(255,79,160,.24);
}

.shelves-profile-link{
    display:flex;
    align-items:center;
    gap:10px;
}

.shelves-profile-avatar{
    width:42px;
    height:42px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:50%;

    background:linear-gradient(135deg,#ff4fa0,#8b5cf6);
    color:white;

    font-size:15px;
    font-weight:900;
}

body[data-shelves-auth="guest"] .shelves-auth-member{
    display:none;
}

body[data-shelves-auth="member"] .shelves-auth-guest{
    display:none;
}

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

.shelves-shell{
    width:min(1220px,100%);
    margin:0 auto;
    padding:76px 32px 110px;
}

.shelves-hero{
    max-width:860px;
    margin-bottom:38px;
}

.shelves-kicker{
    display:inline-flex;

    margin-bottom:16px;
    padding:8px 14px;

    border-radius:999px;

    background:rgba(255,255,255,.1);
    color:#cfa9ff;

    font-size:12px;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.shelves-hero h1{
    max-width:780px;

    color:white;

    font-family:Georgia,"Times New Roman",serif;
    font-size:70px;
    line-height:.98;
    letter-spacing:-.04em;
}

.shelves-hero p{
    max-width:760px;

    margin-top:22px;

    color:#d8c8ef;

    font-size:19px;
    line-height:1.65;
}

/* =========================================================
   SEARCH
========================================================= */

.shelves-search-panel{
    display:grid;
    gap:16px;

    margin-bottom:24px;
}

.shelves-search-box{
    min-height:62px;

    display:flex;
    align-items:center;
    gap:12px;

    padding:0 20px;

    border:1px solid rgba(255,255,255,.12);
    border-radius:22px;

    background:rgba(37,19,66,.72);
    backdrop-filter:blur(16px);
}

.shelves-search-box svg{
    width:20px;
    height:20px;
    color:#cfa9ff;
}

.shelves-search-box input{
    width:100%;

    border:none;
    outline:none;

    background:transparent;
    color:white;

    font-size:16px;
    font-weight:700;
}

.shelves-search-box input::placeholder{
    color:#c9b7e8;
}

.shelves-tabs{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.shelves-tabs button{
    min-height:42px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:0 16px;

    border:1px solid rgba(255,255,255,.12);
    border-radius:999px;

    background:rgba(255,255,255,.08);
    color:white;

    font-size:13px;
    font-weight:900;

    cursor:pointer;
    transition:.2s ease;
}

.shelves-tabs button.active,
.shelves-tabs button:hover{
    background:#ff4fa0;
    border-color:#ff4fa0;
}

/* =========================================================
   TOOLBAR
========================================================= */

.shelves-results-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;

    margin-bottom:26px;
    padding:18px 22px;

    border:1px solid rgba(255,255,255,.12);
    border-radius:22px;

    background:rgba(37,19,66,.72);
    backdrop-filter:blur(16px);
}

.shelves-results-toolbar strong{
    display:block;

    color:white;

    font-size:18px;
    font-weight:900;
}

.shelves-results-toolbar span{
    color:#cfa9ff;

    font-size:13px;
    font-weight:800;
}

.shelves-sort-control{
    display:flex;
    align-items:center;
    gap:10px;
}

.shelves-sort-control select{
    min-height:40px;

    padding:0 14px;

    border:1px solid rgba(255,255,255,.12);
    border-radius:12px;

    background:#2d1658;
    color:white;

    font-weight:800;
}

/* =========================================================
   SHELF CARDS
========================================================= */

.shelves-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:22px;
}

.shelf-card{
    min-height:330px;

    display:flex;
    flex-direction:column;

    padding:22px;

    border:1px solid rgba(255,255,255,.12);
    border-radius:28px;

    background:
        linear-gradient(180deg,rgba(255,255,255,.97),rgba(244,234,255,.96));

    color:var(--shelves-text);

    box-shadow:0 24px 70px rgba(0,0,0,.26);
}

.shelf-card-top{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;

    margin-bottom:18px;
}

.shelf-type-pill,
.shelf-count-pill{
    min-height:27px;

    display:inline-flex;
    align-items:center;

    padding:0 10px;

    border-radius:999px;

    font-size:10px;
    font-weight:900;
    letter-spacing:.05em;
    text-transform:uppercase;
}

.shelf-type-pill{
    background:#f0e3ff;
    color:#6b3c93;
}

.shelf-count-pill{
    background:#ffe4f1;
    color:#9f2f68;
}

.shelf-card h2{
    margin:0;

    color:#171224;

    font-family:Georgia,"Times New Roman",serif;
    font-size:34px;
    line-height:1.05;
}

.shelf-owner{
    margin-top:8px;

    color:#7a4ca5;

    font-size:13px;
    font-weight:900;
}

.shelf-description{
    margin-top:14px;

    color:#6f617f;

    font-family:Georgia,"Times New Roman",serif;
    font-size:16px;
    line-height:1.5;
}

.shelf-preview-list{
    display:grid;
    gap:8px;

    margin-top:18px;
}

.shelf-preview-story{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;

    padding:10px 12px;

    border-radius:14px;

    background:rgba(94,42,126,.08);
}

.shelf-preview-story strong{
    min-width:0;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    color:#171224;

    font-size:12px;
    font-weight:900;
}

.shelf-preview-source{
    flex:0 0 auto;

    padding:5px 7px;

    border-radius:999px;

    background:#f0e3ff;
    color:#6b3c93;

    font-size:9px;
    font-weight:900;
    text-transform:uppercase;
}

.shelf-preview-source.external{
    background:#fff1d8;
    color:#8a5a12;
}

.shelf-empty-preview{
    margin-top:18px;
    padding:18px;

    border:1px dashed #d8c8ef;
    border-radius:18px;

    color:#8f82a6;

    font-size:13px;
    font-weight:800;
    text-align:center;
}

.shelf-card-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;

    margin-top:auto;
    padding-top:20px;
}

.shelf-date{
    color:#8f82a6;

    font-size:12px;
    font-weight:800;
}

.shelf-open-link{
    min-height:40px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:0 15px;

    border-radius:999px;

    background:#ff4fa0;
    color:white;
    text-decoration:none;

    font-size:13px;
    font-weight:900;

    box-shadow:0 10px 26px rgba(255,79,160,.22);
}

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

.shelves-empty-state{
    display:none;

    max-width:620px;
    margin:70px auto 0;
    padding:46px;

    text-align:center;

    border:1px solid rgba(255,255,255,.12);
    border-radius:30px;

    background:rgba(37,19,66,.72);
    backdrop-filter:blur(16px);
}

.shelves-empty-state.show{
    display:block;
}

.shelves-empty-icon{
    width:74px;
    height:74px;

    display:flex;
    align-items:center;
    justify-content:center;

    margin:0 auto 20px;

    border-radius:24px;

    background:rgba(255,255,255,.1);
    color:#cfa9ff;
}

.shelves-empty-icon svg{
    width:34px;
    height:34px;
}

.shelves-empty-state h2{
    margin:0;

    font-family:Georgia,"Times New Roman",serif;
    font-size:38px;
}

.shelves-empty-state p{
    max-width:420px;
    margin:14px auto 24px;

    color:#d8c8ef;

    font-size:16px;
    line-height:1.6;
}

.shelves-empty-state a{
    min-height:46px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:0 22px;

    border-radius:999px;

    background:#ff4fa0;
    color:white;
    text-decoration:none;

    font-weight:900;
}

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

@media (max-width:900px){
    .shelves-site-header{
        grid-template-columns:1fr;
        gap:18px;

        padding:18px 22px;
    }

    .shelves-brand-name{
        font-size:26px;
    }

    .shelves-nav{
        width:100%;

        justify-content:flex-start;
        gap:18px;

        overflow-x:auto;
        padding-bottom:4px;
    }

    .shelves-auth{
        width:100%;
        justify-content:flex-start;
    }

    .shelves-shell{
        padding:48px 18px 90px;
    }

    .shelves-hero h1{
        font-size:48px;
    }

    .shelves-results-toolbar{
        align-items:flex-start;
        flex-direction:column;
    }

    .shelves-grid{
        grid-template-columns:1fr;
    }
}

/* =========================================================
   SHELF DISCOVERY SECTIONS
========================================================= */

.shelves-section-stack{
    display:grid;
    gap:42px;
}

.shelves-discovery-section{
    display:grid;
    gap:20px;
}

.shelves-section-heading{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:22px;
}

.shelves-section-kicker{
    display:inline-flex;

    margin-bottom:10px;
    padding:7px 12px;

    border-radius:999px;

    background:rgba(255,255,255,.1);
    color:#cfa9ff;

    font-size:11px;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.shelves-section-heading h2{
    margin:0;

    color:white;

    font-family:Georgia,"Times New Roman",serif;
    font-size:38px;
    line-height:1.05;
}

.shelves-section-heading p{
    max-width:700px;

    margin-top:8px;

    color:#d8c8ef;

    font-size:15px;
    line-height:1.55;
}

.shelves-section-empty{
    display:none;

    padding:24px;

    border:1px dashed rgba(207,169,255,.34);
    border-radius:22px;

    background:rgba(37,19,66,.42);
    color:#cfa9ff;

    font-size:14px;
    font-weight:800;
    text-align:center;
}

.shelves-section-empty.show{
    display:block;
}

.shelf-curator-badge{
    min-height:27px;

    display:inline-flex;
    align-items:center;
    gap:6px;

    padding:0 10px;

    border-radius:999px;

    font-size:10px;
    font-weight:900;
    letter-spacing:.05em;
    text-transform:uppercase;
}

.shelf-curator-badge.staff{
    background:#ff4fa0;
    color:white;
}

.shelf-curator-badge.recognized{
    background:#fff1d8;
    color:#8a5a12;
}

.shelf-curator-badge.community{
    background:#f0e3ff;
    color:#6b3c93;
}

.shelf-owner-line{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;

    margin-top:8px;
}

.shelf-owner-line .shelf-owner{
    margin-top:0;
}

@media (max-width:760px){
    .shelves-section-heading h2{
        font-size:30px;
    }
}

/* =========================================================
   IMAGE-LED SHELF CARDS
========================================================= */

.shelf-card{
    min-height:430px;
    padding:0;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.14);
    background:rgba(37,19,66,.94);
    color:white;
    box-shadow:0 26px 72px rgba(0,0,0,.30);
}

.shelf-card-image{
    position:relative;
    height:168px;
    overflow:hidden;
    background:
        radial-gradient(circle at 20% 20%,rgba(255,79,160,.28),transparent 36%),
        linear-gradient(135deg,#70409c,#2d1658 58%,#160b31);
}

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

.shelf-card:hover .shelf-card-image img{
    transform:scale(1.035);
}

.shelf-card-image-overlay{
    position:absolute;
    inset:0;
    pointer-events:none;
    background:
        linear-gradient(180deg,rgba(13,5,28,.06) 35%,rgba(17,7,35,.68) 100%);
}

.shelf-card-image-fallback{
    position:absolute;
    inset:0;
    display:grid;
    place-items:center;
    align-content:center;
    gap:9px;
    color:#eadcff;
    text-align:center;
    font-size:11px;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.shelf-card-image-fallback svg{
    width:34px;
    height:34px;
    color:#ff4fa0;
}

.shelf-card .shelf-card-top{
    position:absolute;
    z-index:2;
    inset:14px 14px auto 14px;
    margin:0;
}

.shelf-card .shelf-curator-badge,
.shelf-card .shelf-count-pill{
    min-height:25px;
    box-shadow:0 8px 20px rgba(0,0,0,.18);
    backdrop-filter:blur(10px);
}

.shelf-card-body{
    display:flex;
    flex:1;
    flex-direction:column;
    padding:20px;
}

.shelf-card h2{
    color:white;
    font-size:30px;
}

.shelf-card .shelf-owner{
    color:#d6b9ff;
}

.shelf-card .shelf-description{
    color:#e5d8f6;
    font-family:Inter,sans-serif;
    font-size:14px;
    line-height:1.55;
}

.shelf-card .shelf-preview-story{
    background:rgba(255,255,255,.08);
}

.shelf-card .shelf-preview-story strong{
    color:white;
}

.shelf-card .shelf-empty-preview{
    border-color:rgba(207,169,255,.32);
    color:#cfa9ff;
    background:rgba(255,255,255,.04);
}

.shelf-card .shelf-date{
    color:#bba9d7;
}

.shelf-card .shelf-open-link{
    box-shadow:0 10px 26px rgba(255,79,160,.25);
}

@media (max-width:900px){
    .shelf-card{
        min-height:390px;
    }

    .shelf-card-image{
        height:190px;
    }
}
