/* ====================================================
   Global resets for the timeline view
==================================================== */

/* Reserve scrollbar gutter on all pages so layout never shifts
   when a page scrollbar appears or disappears.
   scrollbar-gutter: stable handles Edge/Win11 overlay scrollbars;
   overflow-y: scroll is the fallback for older browsers. */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    font-family: 'Inter', system-ui, sans-serif;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
}

html, body.timeline-view {
    height: 100%;
    margin: 0;
    padding: 0;
}

.timeline-view .site-header {
    display: none;
}

.timeline-view .site-main {
    height: 100%;
    padding: 0;
    background: transparent;
    min-height: unset;
}

/* ====================================================
   Full-page layout
==================================================== */

.timeline-page {
    min-height: 100dvh;
    background-color: #111827;
    font-family: 'Inter', system-ui, sans-serif;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center top;
    background-attachment: scroll;
    display: flex;
    flex-direction: column;
}

/* ====================================================
   Hero section (title + nav)
==================================================== */

.timeline-hero {
    position: relative;
    padding: 14px 40px 16px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.5) 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hero-nav {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.hero-title {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 3.5vw, 2.6rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #fde68a;
    text-shadow:
        0 2px 12px rgba(0,0,0,0.9),
        0 0 30px rgba(0,0,0,0.7);
    line-height: 1.1;
}

.hero-description {
    margin: 0;
    font-size: 1rem;
    color: rgba(240, 230, 210, 0.88);
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
    max-width: 600px;
}

/* ── Hero search + jump controls ── */
.hero-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    align-items: center;
}

.search-wrap,
.jump-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(250,180,50,0.25);
    border-radius: 6px;
    padding: 4px 8px;
    backdrop-filter: blur(4px);
}

.ctrl-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

.search-wrap input,
.jump-wrap input {
    background: transparent;
    border: none;
    outline: none;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.85rem;
    width: 160px;
}

.jump-wrap input {
    width: 110px;
}

.search-wrap input::placeholder,
.jump-wrap input::placeholder {
    color: rgba(240,220,180,0.45);
}

#searchClear {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(240,210,150,0.6);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

#searchClear:hover { color: #fde68a; }

#jumpBtn {
    background: rgba(250,180,50,0.15);
    border: 1px solid rgba(250,180,50,0.3);
    border-radius: 4px;
    color: #fde68a;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    cursor: pointer;
    transition: background 0.15s;
}

#jumpBtn:hover { background: rgba(250,180,50,0.3); }

.no-events {
    margin: 60px auto;
    padding: 40px 48px;
    max-width: 480px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(160, 130, 60, 0.35);
    border-radius: 8px;
    backdrop-filter: blur(6px);
    color: rgba(220, 200, 160, 0.9);
    font-size: 1.15rem;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.no-events p {
    margin: 0;
}

/* ====================================================
   Custom confirm modal
==================================================== */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.confirm-box {
    background: #1a1408;
    border: 1px solid rgba(160, 130, 60, 0.5);
    border-radius: 8px;
    padding: 28px 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.confirm-message {
    color: #d4c8a8;
    font-size: 1rem;
    margin: 0 0 22px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.popup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid rgba(250, 180, 50, 0.25);
    background: rgba(17, 24, 39, 0.97);
}

/* ====================================================
   Navigation buttons
==================================================== */

.btn {
    display: inline-block;
    padding: 7px 14px;
    background: rgba(20, 14, 6, 0.75);
    color: #fff4a9;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid rgba(160, 130, 60, 0.45);
    backdrop-filter: blur(4px);
    transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
    background: rgba(40, 30, 10, 0.9);
    border-color: rgba(200, 168, 75, 0.7);
    color: #ffffbb;
}

.btn-inline {
    display: inline-block;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-danger {
    border-color: rgba(160, 50, 40, 0.6);
    color: #ff917c;
}

.btn-danger:hover {
    background: rgba(80, 20, 10, 0.9);
    border-color: rgba(200, 70, 55, 0.8);
    color: #ffd0bb;
}

.btn-update {
    border-color: rgba(60, 130, 80, 0.6);
    color: #7abf8a;
}

.btn-update:hover {
    background: rgba(20, 60, 30, 0.9);
    border-color: rgba(80, 170, 100, 0.8);
    color: #a0dfa8;
}

.btn-backup {
    border-color: rgba(60, 100, 160, 0.6);
    color: #7aafd4;
}

.btn-backup:hover {
    background: rgba(20, 40, 80, 0.9);
    border-color: rgba(80, 140, 210, 0.8);
    color: #a0c8f0;
}

.btn-restore {
    border-color: rgba(140, 80, 20, 0.6);
    color: #d4a050;
}

.btn-restore:hover {
    background: rgba(70, 40, 10, 0.9);
    border-color: rgba(200, 130, 40, 0.8);
    color: #f0c070;
}

/* ====================================================
   Home page timeline list
==================================================== */

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-list-item {
    margin-bottom: 16px;
}

.timeline-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.timeline-list-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.timeline-list-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff991;
    text-decoration: none;
}

.timeline-list-link:hover {
    color: #ffffb3;
    text-decoration: underline;
}

.timeline-list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
}

.timeline-date-range {
    font-size: 0.82rem;
    color: #ffda82;
    font-style: italic;
}

.timeline-event-count {
    font-size: 0.78rem;
    background: rgba(200, 168, 75, 0.3);
    border: 1px solid rgba(200, 168, 75, 0.65);
    color: #ffda82;
    padding: 1px 7px;
    border-radius: 10px;
}

.timeline-list-desc {
    font-size: 0.9rem;
    color: #feeabb;
    margin-top: 4px;
}

/* ====================================================
   Manage Roles table
==================================================== */

.roles-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 600px;
}

.roles-table td {
    padding: 6px 10px;
    vertical-align: middle;
}

.role-order-btns {
    width: 80px;
    white-space: nowrap;
}

.role-name {
    font-size: 1rem;
    color: #d4c8a8;
}

.role-delete-btn {
    text-align: right;
}

/* ====================================================
   Timeline wrapper
==================================================== */

.timeline-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    background: transparent;     /* no tint here — avoids darkening #tl-axis */
    isolation: isolate;
    border-top: 1px solid rgba(160, 130, 60, 0.3);
}

#timeline-above,
#timeline-below {
    flex-shrink: 0;
    /* overflow:hidden removed — it promoted these flex children to GPU
       compositing layers that painted over our SVG/dot overlay siblings.
       Vis.js clips its own content via .vis-timeline { overflow:hidden }. */
    background: rgba(0, 0, 0, 0.32);  /* dark tint only on the actual timelines */
}

/* Collapse vis.js internal axis bars to 0 so the SVG amber line
   sits flush at the seam with no dead-zone padding */
#timeline-above .vis-panel.vis-bottom,
#timeline-below .vis-panel.vis-top {
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}
#timeline-below .vis-panel.vis-top .vis-time-axis {
    border-bottom: none !important;
}

#timeline-above .vis-panel.vis-left,
#timeline-below .vis-panel.vis-left {
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
}

#timeline-above .vis-label,
#timeline-below .vis-label {
    white-space: normal !important;
    word-break: break-word !important;
}

#timeline-above .vis-time-axis .vis-text {
    display: none !important;
}

#timeline-above .vis-time-axis {
    background: transparent !important;
    border: none !important;
}


.btn-axis-above {
    border-color: rgba(251, 191, 36, 0.75);
    color: #fbbf24;
}

.btn-axis-above:hover {
    background: rgba(80, 60, 10, 0.9);
    border-color: rgba(253, 230, 138, 0.9);
    color: #fde68a;
}

.btn-axis-below {
    border-color: rgba(120, 100, 50, 0.35);
    color: #9b8a50;
}

.btn-axis-below:hover {
    background: rgba(40, 30, 10, 0.9);
    border-color: rgba(160, 130, 60, 0.6);
    color: #c8a864;
}

.role-axis-btn {
    padding: 6px 10px;
}

/* ====================================================
   Vis.js dark theme overrides
==================================================== */

/* Main container */
.vis-timeline {
    background: transparent !important;
    border: none !important;
}

/* Background panels */
.vis-panel.vis-background,
.vis-panel.vis-center,
.vis-panel.vis-top,
.vis-panel.vis-bottom {
    background: transparent !important;
    border-color: rgba(250, 180, 50, 0.12) !important;
}

/* Left panel (group labels) */
.vis-panel.vis-left {
    background: rgba(0, 0, 0, 0.55) !important;
    border-right: 1px solid rgba(250, 180, 50, 0.2) !important;
}

/* Group label text */
.vis-label {
    color: #fde68a !important;
    font-size: 1.17rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    padding: 0 10px !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(250, 180, 50, 0.1) !important;
    display: flex !important;
    align-items: center !important;
}

.vis-label .vis-inner {
    padding: 6px 0 !important;
}

/* Group rows */
.vis-panel.vis-center .vis-group {
    border-bottom: 1px solid rgba(250, 180, 50, 0.1) !important;
}

/* Time axis */
.vis-time-axis {
    background: transparent !important;
    border-bottom: 3px solid rgba(250, 180, 50, 0.65) !important;
}

.vis-time-axis .vis-text {
    color: #fbbf24 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
}

.vis-time-axis .vis-text.vis-major {
    color: #fde68a !important;
    font-size: 0.8rem !important;
}

/* Grid lines */
.vis-grid.vis-vertical {
    border-color: rgba(250, 180, 50, 0.08) !important;
}

.vis-grid.vis-vertical.vis-major {
    border-color: rgba(250, 180, 50, 0.15) !important;
}

/* The central axis line */
.vis-foreground .vis-group .vis-item-set {
    border-bottom: none !important;
}

/* Hide vis.js built-in connector lines and axis dots for all events.
   Both are replaced by our own SVG lines + HTML-div dots:
   - .vis-item.vis-line renders inconsistently (black on some browsers/versions)
   - .vis-item.vis-dot is clipped to a D-shape by the collapsed vis-panel */
.vis-item.vis-line,
.vis-item.vis-dot {
    display: none !important;
}

/* ====================================================
   Event items
==================================================== */

.vis-item {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(250, 180, 50, 0.45) !important;
    border-radius: 3px !important;
    color: #f1f5f9 !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(250,180,50,0.08) !important;
    cursor: pointer !important;
}

.vis-item:hover {
    border-color: rgba(250, 180, 50, 0.9) !important;
    background: rgba(40, 55, 80, 0.98) !important;
    box-shadow: 0 3px 14px rgba(0,0,0,0.7), 0 0 8px rgba(250,180,50,0.15) !important;
    z-index: 10 !important;
}

.vis-item.vis-selected {
    border-color: #fbbf24 !important;
    background: rgba(45, 65, 95, 0.98) !important;
    box-shadow: 0 0 0 1px #fbbf24, 0 4px 16px rgba(0,0,0,0.8) !important;
}

/* Item content */
.vis-item .vis-item-content {
    padding: 4px 8px !important;
    white-space: nowrap !important;
    color: #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

/* Images inside items */
.vis-item img {
    height: 36px !important;
    width: auto !important;
    object-fit: contain !important;
    border-radius: 2px !important;
    opacity: 0.9;
}

/* Connector dot on axis */
.vis-item.vis-box .vis-item-overflow {
    overflow: visible !important;
}

.vis-item.vis-dot {
    border-color: #fbbf24 !important;
    border-width: 6px !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.7) !important;
}

/* Connector line from event box down to the timeline axis */
.vis-item.vis-line {
    border-left-width: 1.5px !important;
    border-left-color: #fbbf24 !important;
    opacity: 1 !important;
    box-shadow: 0 0 4px rgba(251, 191, 36, 0.5) !important;
}

/* Range items */
.vis-item.vis-range {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(250, 180, 50, 0.4) !important;
}

/* ====================================================
   Popup
==================================================== */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(17, 24, 39, 0.97);
    border: 1px solid rgba(250, 180, 50, 0.45);
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(250,180,50,0.12);
    max-width: 960px;
    width: 90%;
    max-height: 85vh;
    display: none;
    flex-direction: column;
    z-index: 2001;
    color: #f1f5f9;
    overflow: hidden;
}

.popup-inner {
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.popup-inner h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: #f0e0b0;
    font-weight: 700;
}

.popup-date {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #b8973a;
    font-weight: 600;
}

/* Markdown rendered description */
.popup-desc p  { margin: 0 0 8px; }
.popup-desc p:last-child { margin-bottom: 0; }
.popup-desc ul, .popup-desc ol { margin: 0 0 8px; padding-left: 20px; }
.popup-desc strong { color: #fde68a; }
.popup-desc em { color: rgba(240,230,200,0.85); }
.popup-desc a  { color: #fbbf24; }

/* Gallery carousel */
.gallery-wrap {
    position: relative;
    margin: 12px 0;
    text-align: center;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    max-height: 330px;
    object-fit: contain;
    display: block;
}

.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(250,180,50,0.3);
    border-radius: 4px;
    color: #fde68a;
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s;
}

.gallery-btn:hover { background: rgba(0,0,0,0.8); }
.gallery-prev { left: 4px; }
.gallery-next { right: 4px; }

.gallery-ctr {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 0.75rem;
    color: rgba(240,220,160,0.7);
}

.popup-desc {
    margin: 0 0 16px;
    font-size: 20px;
    color: #c8bca0;
    line-height: 1.6;
}

.popup-img {
    width: 45% !important;
    max-width: 320px !important;
    max-height: 480px !important;
    object-fit: contain !important;
    object-position: center top !important;
    border-radius: 4px !important;
    margin: 0 16px 12px 0 !important;
    display: block !important;
    float: left !important;
    background: #000 !important;
}

.popup-inner::after {
    content: "";
    display: block;
    clear: both;
}

.popup-inner h3,
.popup-date,
.popup-desc {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* ====================================================
   Non-timeline pages (forms, home, etc.)
==================================================== */

.site-header {
    background: #1a1208;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(160, 130, 60, 0.3);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-title {
    margin: 0;
    font-size: 1.4rem;
    color: #ffda82;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.site-header-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.auth-username {
    font-size: 0.85rem;
    color: #d0bb7c;
}

.auth-admin-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(160, 130, 60, 0.18);
    border: 1px solid rgba(160, 130, 60, 0.4);
    color: #b89040;
    padding: 1px 6px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
}

.site-main {
    padding: 24px;
    background:
        linear-gradient(rgba(12, 9, 4, 0.88), rgba(12, 9, 4, 0.88)),
        url('/static/images/bg_parchment.jpg') center / cover fixed;
    color: #d4c8a8;
    min-height: calc(100vh - 54px);
}

h2 {
    color: #c8a864;
}

label {
    color: #c8bca0;
}

input[type="text"],
textarea,
select {
    background: #1e1a0e;
    border: 1px solid rgba(160, 130, 60, 0.4);
    color: #e8dcc8;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 1.05rem;
}

button[type="submit"] {
    background: #5a3e18;
    color: #f0e0b0;
    border: 1px solid rgba(160,130,60,0.5);
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

button[type="submit"]:hover {
    background: #7a5520;
}

a {
    color: #b8973a;
}

a:hover {
    color: #d4b050;
}

/* Flash messages */
.flash-container {
    margin-bottom: 20px;
}

.flash {
    padding: 11px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.92rem;
    border: 1px solid transparent;
    border-left-width: 4px;
    border-left-style: solid;
}

.flash-success {
    background: rgba(25, 50, 16, 0.85);
    border-color: rgba(60, 120, 40, 0.4);
    border-left-color: #5aaa3a;
    color: #90d070;
}

.flash-error {
    background: rgba(55, 12, 8, 0.85);
    border-color: rgba(140, 40, 30, 0.4);
    border-left-color: #c84a3a;
    color: #e07060;
}

/* ====================================================
   Add / Edit Event form layout
==================================================== */

.event-form-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.event-form-fields {
    flex: 0 0 360px;
    width: 360px;
}

.event-form-fields input[type="text"],
.event-form-fields select {
    width: 100%;
    box-sizing: border-box;
}

.event-form-description {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    flex-direction: column;
}

.event-form-description label {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.desc-textarea {
    width: 100%;
    min-height: 420px;
    box-sizing: border-box;
    resize: vertical;
    background: #1e1a0e;
    color: #d4c8a8;
    border: 1px solid rgba(160, 130, 60, 0.4);
    border-radius: 4px;
    padding: 10px;
    font-size: 20px;
    font-family: inherit;
    line-height: 1.5;
}

/* ====================================================
   Map form preview (Add / Edit Event pages)
==================================================== */

.map-form-preview {
    margin-top: 14px;
    border-top: 1px solid rgba(160, 130, 60, 0.25);
    padding-top: 12px;
}

.map-preview-label {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: #a09060;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.map-preview-img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid rgba(160, 130, 60, 0.3);
    display: block;
}

/* ====================================================
   Map popup overlay (timeline view)
==================================================== */

.map-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 3000;
    backdrop-filter: blur(4px);
}

.map-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3001;
    max-width: 90vw;
    max-height: 88vh;
    outline: none;
    border: 1px solid rgba(160, 130, 60, 0.5);
    border-radius: 6px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.95);
    overflow: hidden;
    background: #0a0806;
}

.map-popup-img {
    display: block;
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
}

.map-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(20, 14, 6, 0.88);
    border: 1px solid rgba(160, 130, 60, 0.5);
    color: #d4bc82;
    font-size: 1.4rem;
    line-height: 1;
    padding: 3px 10px 5px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.map-close-btn:hover {
    background: rgba(40, 30, 10, 0.95);
    border-color: rgba(200, 168, 75, 0.8);
    color: #f0d890;
}

.btn-map {
    border-color: rgba(60, 120, 160, 0.6);
    color: #80b8d8;
}

.btn-map:hover {
    background: rgba(10, 30, 60, 0.9);
    border-color: rgba(80, 160, 210, 0.8);
    color: #a8d0e8;
}

/* ====================================================
   Manage Assets page
==================================================== */

.assets-page {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    max-width: 1100px;
}

.assets-section {
    flex: 1;
    min-width: 0;
}

.assets-section-title {
    color: #c8a864;
    font-size: 1.1rem;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(160, 130, 60, 0.3);
}

.asset-upload-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.asset-file-label input[type="file"] {
    color: #c8bca0;
    font-size: 0.9rem;
}

.asset-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 22px 16px;
    border: 2px dashed rgba(200, 168, 75, 0.4);
    border-radius: 6px;
    background: rgba(20, 14, 6, 0.4);
    color: #c8bca0;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.asset-dropzone-icon {
    font-size: 1.1rem;
    color: #c8a864;
}

.asset-dropzone:hover,
.asset-dropzone-active {
    background: rgba(40, 30, 10, 0.65);
    border-color: rgba(251, 191, 36, 0.85);
    color: #fde68a;
}

.assets-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
}

.asset-card {
    background: rgba(20, 14, 6, 0.7);
    border: 1px solid rgba(160, 130, 60, 0.2);
    border-radius: 5px;
    padding: 6px 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.asset-card:hover {
    border-color: rgba(200, 168, 75, 0.5);
    background: rgba(30, 22, 8, 0.8);
}

.asset-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    background: #0a0806;
    display: block;
    flex-shrink: 0;
    cursor: zoom-in;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    z-index: 1;
}

.asset-card:hover .asset-thumb {
    transform: scale(4);
    z-index: 200;
    box-shadow: 0 6px 24px rgba(0,0,0,0.85);
    border-radius: 4px;
}

.asset-name {
    font-size: 0.78rem;
    color: #9a8c70;
    text-align: left;
    word-break: break-all;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-card form {
    flex-shrink: 0;
}

.assets-empty {
    color: #7a6e58;
    font-style: italic;
    font-size: 0.9rem;
}

.assets-link-hint {
    font-size: 0.8rem;
    font-weight: 400;
    color: #7a6e58;
}

/* ====================================================
   Auth forms (login / setup)
==================================================== */

.auth-form-wrap {
    max-width: 380px;
    margin: 48px auto;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.auth-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
}

.auth-form button[type="submit"] {
    width: 100%;
    margin-top: 6px;
    padding: 10px;
    font-size: 1rem;
}

.home-login-hint {
    margin-top: 28px;
    font-size: 0.88rem;
    color: #e4d0a6;
}

/* ====================================================
   Admin – user management
==================================================== */

.admin-users-page {
    max-width: 860px;
}

.admin-section {
    margin-bottom: 48px;
}

.admin-section-title {
    color: #c8a864;
    font-size: 1.05rem;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(160, 130, 60, 0.3);
}

.admin-add-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 560px;
}

.admin-add-fields {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.admin-add-fields > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-add-fields input[type="text"],
.admin-add-fields input[type="password"] {
    width: 180px;
}

.admin-add-admin-check {
    padding-bottom: 6px;
}

.admin-add-admin-check label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    color: #c8bca0;
}

.user-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-card {
    background: rgba(20, 14, 6, 0.65);
    border: 1px solid rgba(160, 130, 60, 0.28);
    border-radius: 6px;
    padding: 18px 20px;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.user-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #d4bc82;
}

.user-card-you {
    font-size: 0.8rem;
    color: #7a6e58;
    font-style: italic;
}

.user-perm-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-perm-admin label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    color: #c8bca0;
    font-size: 0.9rem;
}

.user-perm-label {
    margin: 0 0 6px;
    font-size: 0.8rem;
    color: #a09060;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-perm-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.user-perm-check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #c8bca0;
    font-size: 0.88rem;
}

.user-perm-password label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: #9a8c70;
}

.user-perm-password input[type="password"] {
    width: 220px;
    font-size: 0.92rem;
}
