@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    /* Main colors */
    --background-dark: #090E18;
    --background-default: #0C111B;
    --background-light: #182135;

    --background-hover: #111A2B;

    --gold-primary: #E2B97F;
    --gold-light: #ECD2AC;

    /* Text colors*/
    --text-primary: #E7E6E4;
    --text-bright: #FFFFFF;
    --text-secondary: #CFCCC9;
    --text-dark: var(--background-dark);

    /* Gallery Bookshelf colors */
    --bookshelf-base: #24110D;
    --bookshelf-panel: #2A0F0C;
    --bookshelf-panel-dark: #160605;
    --bookshelf-frame: #3A1712;
    --bookshelf-frame-dark: #2A100D;
    --bookshelf-shelf-top: #24110D;
    --bookshelf-shelf-mid: #331813;
    --bookshelf-shelf-dark: #24110D;
    --bookshelf-highlight: rgba(255, 210, 170, 0.08);

    /* Album elements */
    --paper-primary: #DCD4C1;
    --paper-hover: #E1DACA;
    --polaroid-frame: #f5f0e8;
    --album-text: #2B2F32;

    /* Admin colors */
    --purple-primary: #653DC1;
    --purple-hover: #7b56d1;
    --border-purple: 1px solid var(--purple-primary);
    --purple-dark: #181826;
    --red-primary: #D53E34;
    --red-dark: #201518;

    /* Shadow */
    --shadow: 0 0 24px rgba(0, 0, 0, 0.25);

    /* Borders */
    --border-gold: 1px solid var(--gold-primary);
    --border-dark: 1px solid var(--background-light);
    --border-light: 1px solid var(--text-secondary);


    /* Border radius */
    --radius: 4px;

    /* Animation speeds */
    --transition-fast: 0.2s ease;

    /* Hover animations*/
    --hover-small: translateY(-2px);
    --hover-medium: translateY(-4px);

    /* Typography */
    --font-family: 'Montserrat', sans-serif;
    --font-small: 14px;
    --font-body: 16px;
    --font-medium: 20px;
    --font-large: 24px;
    --font-hero-small: 36px;
    --font-hero: 42px;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}
* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--background-default);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
}

/* Top navigation bar */
.navbar {
    height: 64px;
    display: grid;
    grid-template-columns: 240px 1fr 192px;
    align-items: center;
    gap: 32px;
    padding: 0 16px;
    background: var(--background-dark);
}

/* Left side branding in navbar */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gold-primary);
    font-weight: var(--font-weight-bold);
}

.brand img {
    width: 48px;
    height: 48px;
}

/* Navigation links container */
.nav-links {
    display: flex;
    justify-content: right;
    gap: 24px;
}

/* Navigation link styling */
.nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    min-width: clamp(80px, 10vw, 192px);
    padding: 8px 32px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-body);
    font-weight: var(--font-weight-medium);
    background: var(--background-default);
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.nav-links a:hover {
    color: var(--gold-light);
    background: var(--background-hover);
    transform: var(--hover-small);
    border-color: var(--gold-primary)
}

.nav-links a.active {
    background: var(--background-light);
    color: var(--text-bright);
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: clamp(80px, 10vw, 192px);
    color: var(--gold-primary);
    text-decoration: none;
    font-size: var(--font-body);
    font-weight: var(--font-weight-medium);
    border: var(--border-gold);
    border-radius: var(--radius);
}

.login-button:hover {
    background: var(--gold-primary);
    color: var(--text-dark);
    transform: var(--hover-small);
}

/* Notice banner */
.overlay-banner {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 100%;
}


/* Main hero section */
.hero {
    min-height: 560px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 80px;
    background:
        linear-gradient(
        90deg,
        rgba(12, 17, 27, 1) 0%,
        rgba(12, 17, 27, 0.98) 18%,
        rgba(12, 17, 27, 0.92) 28%,
        rgba(12, 17, 27, 0.40) 42%,
        rgba(12, 17, 27, 0.15) 65%,
        rgba(12, 17, 27, 0.05) 100%
        ),
        url("assets/backgrounds/hero.png");
    background-size: 90% auto;
    background-repeat: no-repeat;
    background-position: center right;
}


.hero-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    text-align: center;
    margin-left: 80px;
}

.hero h1 {
    font-size: var(--font-hero);
    margin: 8px 0 12px;
}

.hero p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.eyebrow {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-large);
}

/* Main button styling */
.primary-button {
    display: inline-block;
    align-self: center;
    min-width: 260px;
    margin-top: 16px;
    background: var(--gold-primary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
    text-decoration: none;
    border: var(--border-gold);
    padding: 8px 16px;
    border-radius: var(--radius);
}

.primary-button:hover {
    transform: var(--hover-small);
    background: var(--gold-light);
    box-shadow: var(--shadow);
}

/* Portal cards */
.portal-grid {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 8px 32px 32px;
    min-height: calc(100vh - 64px - 560px);
}

.portal-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    color: inherit;
    border: var(--border-gold);
    background: var(--background-default);
    padding: 24px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.portal-card:hover {
    transform: var(--hover-medium);
    border-color: var(--gold-light);
}

.card-image {
    flex: 1 1 auto;
    min-height: 120px;
    overflow: hidden;
    background: var(--background-light);
    margin: -24px -24px 32px;
    border-bottom: var(--border-gold);
    border-radius: var(--radius);
}

.portal-card h2 {
    color: var(--gold-primary);
    font-size: var(--font-large);
}

.portal-card p {
    color: var(--text-primary);
    font-size: var(--font-body);
    line-height: 1.5;
}

.card-icon {
    width: 64px;
    height: 64px;
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -64px auto 20px;
    background: var(--background-dark);
    border: var(--border-gold);
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

.card-icon svg {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.card-content {
    height: 220px;
    padding: 0px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.map-page {
    min-height: calc(100vh - 64px);
    background: var(--background-default);
}

.map-status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--background-light);
    color: var(--text-primary);
    font-size: var(--font-small);
}

.map-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    border-radius: var(--radius);
}

.map-status-banner strong {
    color: var(--gold-primary);
}

.map-shell {
    height: calc(100vh - 64px - 48px);
    padding: 24px;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--background-dark);
    border: var(--border-gold);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.map-placeholder h1 {
    color: var(--gold-primary);
    font-size: var(--font-hero-small);
    margin: 0 0 12px;
}

.map-placeholder p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Gallery page */
.gallery-page {
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 32px;
    padding: 32px;
    background:
        var(--background-default);
}

.gallery-sidebar {
    padding: 32px;
    border-right: var(--border-gold);
}

.gallery-sidebar h1 {
    color: var(--gold-primary);
    font-size: var(--font-hero);
    line-height: 1.5;
    margin: 12px 0 24px;
}

.gallery-sidebar p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.disabled-button {
    margin-top: 32px;
    gap: 16px;
    pointer-events: none;
    opacity: 0.50;
}

.disabled-button span {
    font-size: var(--font-small);
    font-weight: var(--font-weight-light);
}

.search-bar {
    margin-top: 24px;
    padding: 16px;
    color: var(--text-secondary);
    border: var(--border-dark);
    border-radius: var(--radius);
    background: var(--background-dark);
}

.gallery-info-card {
    margin-top: 64px;
    padding: 24px;
    background: var(--background-dark);
    border: var(--border-gold);
    border-radius: var(--radius);
}

.gallery-info-card h2 {
    color: var(--gold-primary);
}

.bookshelf {
    position: relative;
    overflow: hidden;
    align-self: start;
    padding: 32px;
    background: 
        linear-gradient(90deg, rgba(255, 200, 140, 0.04), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.25)),
        linear-gradient(180deg, rgba(255, 210, 160, 0.04), rgba(0, 0, 0, 0.2)),
        var(--bookshelf-base);

    /* border: 10px solid var(--bookshelf-frame-dark); */
    border-radius: var(--radius);
    box-shadow: 
        inset 0 0 0 1px rgba(226, 185, 127, 0.12),
        inset 0 0 40px rgba(0, 0, 0, 0.45),
        var(--shadow);
}

.shelf-row {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: grid;
    grid-template-columns: minmax(300px, auto) auto 1fr;
    /* display: flex; */
    align-items: center;
    gap: 20px;
    padding: 24px 48px 16px;
    color: inherit;
    text-decoration: none;
    background:
        radial-gradient(
        circle at  top left,
        rgba(255, 180, 120, 0.03),
        transparent 40%),

        linear-gradient(
            to top,
            var(--bookshelf-panel) 0%,
            var(--bookshelf-panel-dark) 100%);
    box-shadow: 
    inset 0 -40px 60px rgba(0, 0, 0, 0.45),
    inset 0 0px 60px rgba(0, 0, 0, 0.035);
    box-sizing: border-box;
    outline: 1px solid transparent;
}

.shelf-row + .shelf-row {
    margin-top: 0px;
}

.shelf-row:hover {
    background:
        radial-gradient(
            circle at center,
            rgba(255, 190, 120, 0.025),
            transparent 70%
        ),
        radial-gradient(
            circle at top left,
            rgba(255, 180, 120, 0.03),
            transparent 40%
        ),
        linear-gradient(
            to top,
            var(--bookshelf-panel) 0%,
            var(--bookshelf-panel-dark) 100%
        );
    /* outline: var(--border-gold); */
    border-radius: var(--radius);
    z-index: 2;
}

.shelf-row::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 16px;
    background: 
    linear-gradient(
        to bottom,
        var(--bookshelf-shelf-top) 0%,
        var(--bookshelf-shelf-mid) 35%,
        var(--bookshelf-shelf-dark) 100%
    );
    box-shadow:
    inset 0 -3px 8px rgba(0, 0, 0, 0.45),
    0 6px 12px rgba(0, 0, 0, 0.35);
}

.shelf-player {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    background: var(--background-light);
    border: var(--border-gold);
    border-radius: var(--radius);
}

.shelf-player h2 {
    /* max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis; */
    margin: 0 0 6px;
    color: var(--text-bright);
    font-size: var(--font-medium);
}

.shelf-player p {
    margin: 0;
    color: var(--gold-primary);
}

.shelf-books {
    display: flex;
    align-items: end;
    align-self: end;
    gap: 0px;
}

.book-img {
    height: 148px;
    width: auto;
    display: block;
    filter: drop-shadow(8px 8px 8px rgba(0, 0, 0, 0.45));
}

.book {
    height:148px;
    width: 40px;
    border-radius: 8px;
    background: 
        linear-gradient(
            90deg,
            var(--book-edge) 0%,
            var(--book-edge) 18%,
            var(--book-main) 18%,
            var(--book-main) 82%,
            var(--book-edge) 82%,
            var(--book-edge) 100%
        );
    transform-origin: bottom center;
    position: relative;
    flex-shrink: 0;
    margin-left: 0;
    margin-right: 0;
}

.book-thin { width: 24px; }
.book-medium-width { width: 38px; }
.book-thick { width: 52px; }

.book-short { height: 132px; }
.book-medium-height { height: 148px; }
.book-tall { height: 164px; }

.book-red {
    --book-main: #71261E;
    --book-edge: #63211A;
}

.book-blue {
    --book-main: #263348;
    --book-edge: #1C2739;
}

.book-green {
    --book-main: #3F4A24;
    --book-edge: #343E1D;
}

.book-purple {
    --book-main: #4C2639;
    --book-edge: #3F1D31;
}

.book-brown {
    --book-main: #6C3918;
    --book-edge: #5C2B11;
}

.book-yellow {
    --book-main: #AC6723;
    --book-edge: #985619;
}

.book-cyan {
    --book-main: #24443E;
    --book-edge: #1B3632;
}

.book-grey {
    --book-main: #3F3F3F;
    --book-edge: #323232;
}

/* .book:not(.book-lean-left):not(.book-lean-right) {
    margin-left: -1px;
    margin-right: -1px;
} */

.book-lean-left {
    transform: rotate(-4deg);
    transform-origin: bottom center;
    margin-left: 10px;
}

.book-lean-right {
    transform: rotate(4deg);
    transform-origin: bottom center;
    margin-right: 10px;
}

.book-lean-left + .book-lean-left {
    margin-left: 1px;
}

.book-lean-right + .book-lean-right {
    margin-left: -9px;
}

.book::before,
.book::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background:
        linear-gradient(to bottom, var(--gold-light) 0 2px, transparent 2px 4px, var(--gold-light) 4px 6px
        );
}

.book::before {
    top: 16px;
}

.book::after {
    bottom: 16px;
}

.shelf-spacer {
    min-width: 0;
}


/* Album Editor */
.album-page {
    height: 100vh;
    padding: 24px;
    display: grid;
    grid-template-rows: 1fr auto;
    place-items: center;
    overflow: hidden;
    background: var(--background-default);
}

.album-viewer {
    width: min(96vw, calc((100vh - 96px) * 1.333));
    max-width: 96vw;
    aspect-ratio: 4 / 3;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.album-spread {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--paper-primary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.album-content {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    background: transparent;
    border-radius: var(--radius);
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.album-cover {
    height: 100%;
    aspect-ratio: 2 / 3;
    position: relative;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow);
    color: var(--gold-primary);
    background:
        linear-gradient(
            90deg,
            var(--book-edge) 0%,
            var(--book-edge) 2%,
            var(--book-main) 2%,
            var(--book-main) 100%,
            var(--book-main) 100%
        );
    border-radius: var(--radius);
}

.album-cover-content {
    max-width: 420px;
}

.album-cover,
.album-paper-page {
    height: 100%;
    min-height: 0px;
}

.album-cover-icon {
    width: 160px;
    height: 160px;
    object-fit: contain;
    image-rendering: pixelated;
    margin-bottom: 24px;
}

.album-cover-content h2 {
    font-size: clamp(32px, 4vw, 56px);
    line-height: 1.1;
    margin: 0 0 16px;
}

.album-cover-description {
    line-height: 1.5;
    margin: 0;
}

.album-cover-trim {
    position: absolute;
    left: 0px;
    right: 0px;
    height: 8px;
    background: 
        linear-gradient(
            to bottom,
            var(--gold-light) 0 2px,
            transparent 2px 5px,
            var(--gold-light) 5px 8px
        );
}

.album-cover-trim-top {
    top: 48px;
}

.album-cover-trim-bottom {
    bottom: 48px;
}


.album-paper-page {
    height: 100%;
    display: grid; 
    grid-template-rows: repeat(3, 1fr);
    padding: 32px;
    background: var(--paper-primary);
}

.album-paper-page:first-child {
    border-right: 1px solid rgba(80, 50, 20, 0.25);
}

.album-controls {
    display: flex;
    padding: 24px 0 0;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.album-slot {
    display: grid;
    grid-template-columns: 32% 1fr;
    align-items: center;
    gap: 6%;
    width: 100%;
    min-height: 0;
    padding: 4%;
    container-type: inline-size;
    border-radius: var(--radius);
    color: var(--album-text);
}

.album-slot-filled {
    position: relative;
    grid-template-columns: 34% 1fr;
}

.album-slot-filled:hover .delete-element-button {
    opacity: 1;
}

.empty-slot-button {
    grid-column: 1 / -1;
    width: 100%;
    height: 100%;
    min-height: 140px;
    border: 1px dashed rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: var(--album-text);
    font-size: var(--font-large);
    cursor: pointer;
    border-radius: var(--radius);
}

.delete-element-button {
    height: 24px;
    width: 24px;
    border: none;
    background: none;
    border-radius: var(--radius);
    padding: 0;
    cursor: pointer;
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
}

.album-slot-filled:has(.delete-element-button:hover) {
    border: 1px solid var(--red-primary);
}

.delete-element-button svg {
    color: var(--red-primary);
    width: 100%;
    height: 100%;
    display: block;
}

.polaroid-element {
    width: 100%;
    /* max-width: 180px; */
    justify-self: center;
    padding: 6% 6% 18%;
    background: var(--polaroid-frame);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.polaroid-image-wrapper {
    position: relative;
}

.add-polaroid-button {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
}

.add-polaroid-button img {
    width: 32px;
    height: 32px;
}

.replace-polaroid-button {
    height: 32px;
    width: 32px;
    position: absolute;
    right: 6px;
    bottom: 6px;
    opacity: 0;
    border: none;
    color: var(--album-text);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 4px;
}

.polaroid-image-wrapper:hover .replace-polaroid-button {
    opacity: 1;
}

.replace-polaroid-button svg {
    width: 100%;
    height: 100%;
    display: block;
}

.polaroid-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(60, 35, 15, 0.18);
}

.polaroid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.polaroid-text {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.polaroid-text h3 {
    font-size: clamp(14px, 4cqw, 22px);
    line-height: 1.5;
    margin: 0 0 8px;
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--album-text);
}

.polaroid-text p {
    /* font-size: clamp(12px 3cqw, 16px); */
    font-size: var(--font-body);
    line-height: 1.5;
    margin: 0;
    color: var(--album-text);
    padding: 8px 16px;
    border-radius: var(--radius);
    /* display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical; */
    overflow: hidden;
}

.editable-text-wrapper {
    position: relative;
}

.editable-polaroid-title,
.editable-polaroid-description {
    padding-right: 24px;
}

.edit-text-icon {
    position: absolute;
    right: 6px;
    top: 4%;
    width: 16px;
    height: 16px;
    opacity: 0;
    color: var(--album-text);
    pointer-events: none;
    transition: opacity 0.2 ease;
}

.editable-text-wrapper:hover .edit-text-icon, .editable-text-wrapper:focus-within .edit-text-icon {
    opacity: 0.5;
}

[contenteditable="true"] {
    outline: none;
    cursor: text;
}

[contenteditable="true"]:hover {
    background: var(--paper-hover);
}

[contenteditable="true"]:focus {
    background: var(--paper-hover);
    border: var(--border-gold);
}


/* admin page */
.admin-page {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 32px;
    padding: 48px;
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 48px;
    height: calc(100vh - 96px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 32px;
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.admin-page h1 {
    font-size: var(--font-hero);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 8px;
}

.admin-page p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.admin-card {
        background: var(--background-dark);
        border: var(--border-dark);
        border-radius: var(--radius);
        padding: 16px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
        flex-shrink: 0;
}

.admin-card-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        background: var(--background-dark);
        border-radius: var(--radius);
        gap: 32px;
        padding: 16px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.25),
}

.user-card {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background-dark);
        border: var(--border-dark);
        border-radius: var(--radius);
        padding: 24px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.25),
}

.user-card h2{
    font-size: var(--font-large);
    margin-bottom: 20px;
}

.user-item.selected {
    background: var(--purple-dark);
    border-color: var(--purple-hover);
    box-shadow: 0 0 0 1px var(--purple-hover);
}

.admin-card h2 {
    font-size: var(--font-large);
    margin-bottom: 20px;
}

.admin-card form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-card input,
.admin-card select {
    padding: 16px;
    color: var(--text-secondary);
    border: var(--border-purple);
    border-radius: var(--radius);
    background: var(--background-dark);
}

.user-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 320px;
}

.user-edit-fields input {
    padding: 12px 14px;
    background: var(--background-default);
    border: var(--border-purple);
    border-radius: var(--radius);
    color: var(--text-primary);
}

.user-actions {
    display: flex;
    gap: 16px;
    margin-left: auto;
    align-self: flex-start;
}

.admin-button {
    display: flex;
    flex-direction: row;
    min-width: 260px;
    margin-top: 16px;
    background: var(--purple-primary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    text-decoration: none;
    border: var(--border-purple);
    padding: 8px 16px;
    gap: 24px;
    border-radius: var(--radius);
}

.admin-button:hover {
    transform: var(--hover-small);
    background: var(--purple-hover);
    box-shadow: var(--shadow);
}

#show-add-user {
    display: inline-block;
    align-self: center;
    min-width: 260px;
    margin-top: 16px;
    background: var(--purple-primary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
    text-decoration: none;
    border: var(--border-purple);
    padding: 8px 16px;
    border-radius: var(--radius);

}

#show-add-user:hover {
    transform: var(--hover-small);
    background: var(--purple-hover);
    box-shadow: var(--shadow);
}

#user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    overflow-y: auto;
    min-height: 0;
    padding-right: 8px;
}

 .user-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--background-default);
    border: var(--border-purple);
    cursor: pointer;
    color: var(--text-primary);
}

.user-item:not(.selected):hover {
    background: var(--background-hover);
    border-color: var(--purple-hover);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--background-light);
}

.user-item h3 {
    font-size: var(--font-medium);
    margin-bottom: 4px;
    text-align: left;
}

.user-item p {
    font-size: var(--font-body);
    text-align: left;
}

.books-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.books-table th,
.books-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: var(--border-dark);
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

.books-table td.album-id {
    color: var(--text-secondary);
    font-size: var(--font-small);
    opacity: 50%;
}

.books-table th {
    color: var(--text-secondary);
    font-size: var(--font-small);
    font-weight: var(--font-weight-bold);
}

.books-table td {
    color: var(--text-primary);
    font-size: var(--font-small);
}

.books-table tr:hover {
    background: var(--background-hover);
}

#selected-user-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bookshelf-preview {
    padding: 32px;
    background: 
        linear-gradient(90deg, rgba(255, 200, 140, 0.04), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.25)),
        linear-gradient(180deg, rgba(255, 210, 160, 0.04), rgba(0, 0, 0, 0.2)),
        var(--bookshelf-base);
    border-radius: var(--radius);
    box-shadow: 
        inset 0 0 0 1px rgba(226, 185, 127, 0.12),
        inset 0 0 40px rgba(0, 0, 0, 0.45),
        var(--shadow);
}

.admin-card-header {
    display: flex;
    flex-direction: column;
}

.admin-small-button {
    width: auto;
    padding: 8px 14px;
    border-radius: var(--radius);
    border: var(--border-purple);
    background: var(--purple-dark);
    color: var(--text-bright);
}

.admin-small-button:hover {
    background: var(--purple-primary);
    transform: var(--hover-small);
}

.admin-small-button.danger {
    border-color: var(--red-primary);
    background: var(--red-dark);
    color: var(--red-primary);
}

.admin-small-button.danger:hover {
    background: var(--red-primary);
    color: var(--text-bright);
}

#save-status {
    font-size: var(--font-body);
    color: var(--gold-primary);
    opacity: 0;
    transform: var(--transition-fast);
}

/* placeholders */
.page-placeholder {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.placeholder-card {
    width: 100%;
    max-width: 640px;
    padding: 48px;
    text-align: center;
    background: var(--background-dark);
    border: var(--border-gold);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.placeholder-card h1 {
    color: var(--gold-primary);
    margin-bottom: 16px;
}

.placeholder-card p {
    margin-bottom: 16px;
}

@media (max-width: 1600px) {

        .polaroid-text h3 {
        font-size: var(--font-medium);
    }

    .polaroid-text p {
        font-size: var(--font-small);
    }
}

@media (max-width: 1200px) {

    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        min-height: 520px;
        padding: 64px 48px;
        background-size: 110% auto;
        background-position: center right;
    }
   
    .hero-content {
        margin-left: 24px;
        max-width: 300px;
    }

    .hero h1 {
        font-size: var(--font-hero-small);
    }

    .navbar {
        grid-template-columns: 180px 1fr 140px;
        gap: 16px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        width: clamp(72px, 10vw, 120px);
        min-width: 0;
        padding: 8px 12px;
    }

    .login-button {
        min-width: 0;
        width: 120px;
    }

    /* Gallery Page */
    .gallery-page {
        grid-template-columns: 1fr;
    }

    .gallery-sidebar {
        border-right: none;
        border-bottom: var(--border-gold);
    }

    .shelf-row {
        grid-template-columns: 200px 1fr 48px;
    }
}

@media (max-width: 1100px) {

    .album-spread {
        grid-template-columns: 1fr;
    }

    .album-viewer {
        width: min(92vw, calc((100vh - 120px) * 0.666));
        aspect-ratio: 2 / 3;
    }
}

@media (max-width: 835px) {

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

    .navbar {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 16px;
        gap: 12px;
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .nav-links a,
    .login-button {
        width: 100%;
        min-width: 0;
    }

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

    .hero {
        min-height: 720px;
        padding: 64px 24px;
        background:
            linear-gradient(
                180deg,
                rgba(12, 17, 27, 0.95) 0%,
                rgba(12, 17, 27, 0.55) 45%,
                rgba(12, 17, 27, 0.90) 100%
            ),
            url("assets/backgrounds/hero.png");
        background-size: cover;
        background-position: center;
        
    }


/* Gallery Page */
    .gallery-page {
        padding: 16px;
    }

    .gallery-sidebar {
        padding: 24px;
    }

    .gallery-sidebar h1 {
        font-size: var(--font-hero-small)
    }

    .shelf-row {
        display: grid;
        grid-template-columns: 1fr;
        align-content: end;
        justify-items: center;
        min-height: 260px;
        padding: 32px 24px 0px;
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }

    .shelf-player {
        justify-content: center;
    }

    .shelf-books {
        justify-content: center;
    }

    .book-img {
        height: 96px;
    }
}