/* ============================================================
   SIA Well Wishes - custom styles
   Bootstrap 5 base + custom theme. No CSS variables (var()) used,
   so it drops cleanly into a .NET MVC project.
   Handwriting fonts: Caveat, Kalam.  Display serif: Playfair Display.
   ============================================================ */

/* ---------- Base ---------- */
body {
    background-color: #0a1a3c;
    background-image: radial-gradient(1200px 600px at 80% -10%, #16305f 0%, rgba(10,26,60,0) 60%),
                      linear-gradient(160deg, #0a1a3c 0%, #0b1f44 55%, #0a1733 100%);
    color: #eaeefb;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    min-height: 100vh;
}

.text-gold { color: #e6c45e; }
.bg-navy   { background-color: #0a1a3c; }

/* ---------- Navigation (navigation.js) ---------- */
.sia-navbar {
    background-color: rgba(8, 18, 42, 0.92);
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    backdrop-filter: blur(4px);
}
.sia-navbar .navbar-brand {
    color: #e6c45e;
    font-family: "Playfair Display", Georgia, serif;
    letter-spacing: 1px;
    font-weight: 600;
}
.sia-navbar .navbar-brand img { height: 30px; margin-right: 10px; vertical-align: middle; }
.sia-navbar .brand-sub {
    display: block;
    font-family: "Inter", Arial, sans-serif;
    font-size: 9px;
    letter-spacing: 3px;
    color: #c9a227;
    margin-top: -2px;
}
.sia-navbar .nav-link {
    color: #d7def0;
    letter-spacing: 1px;
    font-size: 0.95rem;
    padding-left: 1rem;
    padding-right: 1rem;
}
.sia-navbar .nav-link:hover { color: #e6c45e; }
.sia-navbar .nav-link.active {
    color: #e6c45e;
    border-bottom: 2px solid #e6c45e;
}
.navbar-toggler { border-color: rgba(212,175,55,0.5); }

/* ---------- Footer (footer.js) ---------- */
.sia-footer {
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    background-color: rgba(8, 18, 42, 0.9);
    color: #9fb0d4;
    font-size: 0.85rem;
    padding: 22px 0;
    margin-top: 40px;
}
.sia-footer .text-gold { color: #c9a227; }

/* ---------- Hero panel (left) ---------- */
.hero-panel {
    position: relative;
    background-image: url("../images/hero-scene.svg");
    background-size: cover;
    background-position: center bottom;
    border-radius: 18px;
    overflow: hidden;
    min-height: 560px;
    padding: 38px 34px;
    border: 1px solid rgba(212, 175, 55, 0.25);
}
.hero-panel .hero-overlay {
    position: relative;
    z-index: 2;
}
.hero-logo { display: flex; align-items: center; margin-bottom: 30px; }
.hero-logo img { height: 34px; margin-right: 12px; }
.hero-logo .wordmark { font-family: "Playfair Display", Georgia, serif; color: #e9eefc; letter-spacing: 2px; font-size: 0.95rem; }
.hero-logo .wordmark small { display:block; color:#c9a227; font-size: 0.6rem; letter-spacing: 3px; }

.hero-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 3.6rem;
    line-height: 1.02;
    color: #e6c45e;
    margin: 0;
}
.hero-title .thin { font-weight: 400; font-style: italic; }
.hero-lead {
    color: #c8d2ea;
    max-width: 360px;
    margin-top: 18px;
    line-height: 1.6;
}
.hero-note {
    color: #d2af4f;
    font-family: "Caveat", cursive;
    font-size: 1.5rem;
    margin-top: 16px;
}

/* ---------- Board panel (right) ---------- */
.board-panel {
    background-color: rgba(13, 28, 62, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 18px;
    padding: 26px 26px 34px;
    position: relative;
    min-height: 560px;
}
.board-head {
    font-family: "Caveat", cursive;
    color: #e6c45e;
    font-size: 1.8rem;
    margin-bottom: 6px;
}
.board-foot {
    text-align: center;
    color: #c8d2ea;
    font-family: "Caveat", cursive;
    font-size: 1.5rem;
    margin-top: 26px;
}

/* corner stamp + postmark decoration */
.board-stamp  { position: absolute; top: -26px; right: 18px; width: 86px; transform: rotate(6deg); filter: drop-shadow(0 6px 10px rgba(0,0,0,0.4)); }
.board-postmark { position: absolute; top: 30px; right: 110px; width: 96px; opacity: 0.7; transform: rotate(-12deg); }

/* ---------- Wish grid + pagination ---------- */
.wish-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.wish-grid.fade-out { opacity: 0; transform: translateY(8px); }
.wish-grid.fade-in  { opacity: 1; transform: translateY(0); }
.wish-grid {
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.pack-dots { text-align: center; margin-top: 18px; }
.pack-dots span {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: rgba(212,175,55,0.3);
}
.pack-dots span.on { background-color: #e6c45e; }

/* ---------- Wish cards (fixed templates) ---------- */
.wish-card {
    position: relative;
    border-radius: 8px;
    padding: 22px 20px 16px;
    min-height: 180px;
    box-shadow: 0 10px 22px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    text-align: center;            /* centered text on every card */
}

/* Gold washi-tape sticker at the top of every card (like the mockup) */
.wish-card::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    width: 124px;
    height: 26px;
    transform: translateX(-50%) rotate(-2.5deg);
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.14) 0 6px, rgba(255,255,255,0) 6px 12px),
        linear-gradient(135deg, rgba(244,226,166,0.95) 0%, rgba(212,175,55,0.92) 48%, rgba(201,162,39,0.95) 100%);
    border-left: 1px solid rgba(255,255,255,0.35);
    border-right: 1px solid rgba(0,0,0,0.10);
    box-shadow: 0 3px 7px rgba(0,0,0,0.30);
    border-radius: 2px;
    z-index: 4;
    pointer-events: none;
}

.wish-card .quote-mark {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 2.4rem;
    line-height: 0.5;
    opacity: 0.55;
    margin-bottom: 6px;
}
.wish-msg {
    font-family: "Kalam", "Caveat", cursive;
    font-size: 1.18rem;
    line-height: 1.45;
    flex-grow: 1;
}
.wish-name {
    font-family: "Caveat", cursive;
    font-size: 1.3rem;
    margin-top: 12px;
    text-align: center;
}

/* Non-photo cards: vertically centre the quote + message + name group */
.wish-card:not(.tpl-polaroid) { justify-content: center; }
.wish-card:not(.tpl-polaroid) .wish-msg { flex-grow: 0; }

/* template: navy */
.tpl-navy {
    background: linear-gradient(160deg, #15295a 0%, #0e1f47 100%);
    border: 1px solid rgba(212,175,55,0.3);
    color: #eef2ff;
}
.tpl-navy .quote-mark, .tpl-navy .wish-name { color: #e6c45e; }

/* template: cream sticky note */
.tpl-cream {
    background: linear-gradient(170deg, #fbf3da 0%, #f3e7c4 100%);
    color: #3a3324;
    transform: rotate(-1.2deg);
}
.tpl-cream .quote-mark { color: #c9a227; }
.tpl-cream .wish-name { color: #6b5a2c; }

/* template: kraft paper */
.tpl-kraft {
    background: linear-gradient(170deg, #e9dcc0 0%, #d8c39a 100%);
    color: #41361f;
    transform: rotate(1deg);
}
.tpl-kraft .quote-mark { color: #8a6f33; }
.tpl-kraft .wish-name { color: #5c4a22; }

/* template: polaroid (photo) */
.tpl-polaroid {
    background: #fdfbf4;
    color: #2c2a24;
    padding: 12px 12px 14px;
    transform: rotate(-1.5deg);
    border: 1px solid #efe7d0;
}
.tpl-polaroid .polaroid-photo {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    background-color: #0c2150;
    display: block;
    margin: 0 auto 4px;          /* square + centered */
}
.tpl-polaroid .wish-msg {
    margin-top: 10px;
    flex-grow: 1;
    display: flex;
    align-items: center;        /* centre text in the space under the photo */
    justify-content: center;
}
.tpl-polaroid .wish-name { color: #6b5a2c; }

/* ---------- Decorations on cards ---------- */
.decor-tape::before {
    content: "";
    position: absolute;
    top: -12px; left: 50%;
    width: 78px; height: 26px;
    transform: translateX(-50%) rotate(-4deg);
    background-color: rgba(212, 175, 55, 0.55);
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}
.decor-clip::before {
    content: "";
    position: absolute;
    top: -10px; right: 16px;
    width: 16px; height: 42px;
    border: 3px solid #cdb36b;
    border-radius: 8px;
    transform: rotate(12deg);
}
.decor-pin::before {
    content: "";
    position: absolute;
    top: -9px; left: 50%;
    width: 16px; height: 16px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f3d27a, #b9912f);
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}
.decor-heart::after,
.decor-star::after,
.decor-stamp::after {
    position: absolute;
    bottom: 12px; left: 16px;
    font-size: 1.2rem;
    opacity: 0.85;
}
.decor-heart::after { content: "\2661"; color: #d98c8c; font-size: 1.5rem; }
.decor-star::after  { content: "\2605"; color: #c9a227; }
.decor-stamp::after { content: "\2708"; color: #8a6f33; }

/* ---------- Submit page ---------- */
.submit-card {
    background-color: rgba(13, 28, 62, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 18px;
    padding: 30px;
}
.submit-card h1 {
    font-family: "Caveat", cursive;
    color: #e6c45e;
    font-size: 2.4rem;
}
.form-label { color: #cdd6ee; letter-spacing: 0.5px; }
.sia-input, .sia-textarea {
    background-color: rgba(8, 18, 42, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #f0f3ff;
    border-radius: 12px;
}
.sia-input:focus, .sia-textarea:focus {
    background-color: rgba(8, 18, 42, 0.9);
    border-color: #e6c45e;
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.2);
    color: #ffffff;
}
.sia-textarea { font-family: "Kalam", cursive; min-height: 120px; }
.char-count { font-size: 0.85rem; color: #9fb0d4; }
.char-count.warn { color: #e6c45e; }

.btn-gold {
    background: linear-gradient(120deg, #e6c45e 0%, #c9a227 100%);
    border: none;
    color: #2a2410;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 24px;
    padding: 10px 26px;
}
.btn-gold:hover { background: linear-gradient(120deg, #f0d06a 0%, #d4af37 100%); color: #211c0c; }

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #d7def0;
    border-radius: 24px;
}
.btn-ghost:hover { border-color: #e6c45e; color: #e6c45e; }

/* theme picker swatches */
.theme-swatch {
    cursor: pointer;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-family: "Caveat", cursive;
    font-size: 1.05rem;
    border: 2px solid transparent;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-swatch.selected,
input[name="theme"]:checked + .theme-swatch { border-color: #e6c45e; box-shadow: 0 0 0 3px rgba(212,175,55,0.25); }
.sw-navy   { background: linear-gradient(160deg,#15295a,#0e1f47); color:#e6c45e; }
.sw-cream  { background: linear-gradient(170deg,#fbf3da,#f3e7c4); color:#6b5a2c; }
.sw-kraft  { background: linear-gradient(170deg,#e9dcc0,#d8c39a); color:#5c4a22; }
.sw-polaroid { background:#fdfbf4; color:#2c2a24; }

/* photo preview */
.photo-preview {
    width: 220px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(212,175,55,0.35);
    display: none;
    margin: 12px auto 0;          /* square + centered */
}

/* live preview card on submit page */
.preview-wrap { display: flex; justify-content: center; }
.preview-wrap .wish-card { width: 260px; }

/* ---------- Moderator console ---------- */
.mod-title {
    font-family: "Caveat", cursive;
    color: #e6c45e;
    font-size: 2.1rem;
}
.mod-user { color: #9fb0d4; font-size: 0.85rem; margin: 0 6px; }

.mod-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mod-pill {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    background-color: rgba(13, 28, 62, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d7def0;
}
.mod-pill.pill-pending  { border-color: rgba(240, 200, 120, 0.5); color: #f0c878; }
.mod-pill.pill-approved { border-color: rgba(120, 200, 140, 0.5); color: #8fd6a3; }

.mod-card {
    background-color: rgba(13, 28, 62, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 14px;
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.mod-card.is-approved { border-color: rgba(120, 200, 140, 0.45); }
.mod-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mod-tags { color: #9fb0d4; font-size: 0.78rem; letter-spacing: 0.5px; }
.mod-status { font-size: 0.75rem; padding: 2px 10px; border-radius: 12px; font-weight: 600; }
.mod-status.ok      { background-color: rgba(120, 200, 140, 0.18); color: #8fd6a3; }
.mod-status.pending { background-color: rgba(240, 200, 120, 0.18); color: #f0c878; }

.mod-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #0c2150;
}
.mod-message {
    font-family: "Kalam", cursive;
    color: #eef2ff;
    font-size: 1.02rem;
    line-height: 1.4;
    flex-grow: 1;
}
.mod-name { font-family: "Caveat", cursive; color: #e6c45e; text-align: right; font-size: 1.15rem; margin-top: 6px; }
.mod-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}
.mod-actions .form-check-label { color: #cdd6ee; font-size: 0.85rem; }
.mod-actions .form-check-input:checked { background-color: #c9a227; border-color: #c9a227; }

.btn-group .btn-ghost.active { background-color: rgba(212, 175, 55, 0.18); color: #e6c45e; border-color: #e6c45e; }

.mod-modal {
    background-color: #0d1c3e;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #eaeefb;
}
.mod-modal .modal-header, .mod-modal .modal-footer { border-color: rgba(212, 175, 55, 0.2); }
.mod-modal .modal-title { font-family: "Caveat", cursive; color: #e6c45e; font-size: 1.6rem; }

/* ---------- Handwriting font choices ----------
   Applied to .wish-msg (board) and the live preview / textarea on submit.
   Declared after .wish-msg so the chosen font wins. */
.font-caveat   { font-family: "Caveat", cursive; }
.font-kalam    { font-family: "Kalam", cursive; }
.font-patrick  { font-family: "Patrick Hand", cursive; }
.font-shadows  { font-family: "Shadows Into Light", cursive; }
.font-gloria   { font-family: "Gloria Hallelujah", cursive; font-size: 1.02rem; }
.font-dancing  { font-family: "Dancing Script", cursive; font-size: 1.35rem; }
.font-indie    { font-family: "Indie Flower", cursive; }

/* ---------- Display board: fill the viewport, never scroll (TV/desktop) ----------
   Uses an explicit flex chain (no percentage heights) so the wish grid always
   shrinks to the space left between the navbar and footer. */
@media (min-width: 992px) {
    body.display-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

    /* main fills the space between nav and footer */
    body.display-page .display-main {
        flex: 1 1 auto; min-height: 0; overflow: hidden;
        display: flex; flex-direction: column;
        padding-top: 0.8rem !important; padding-bottom: 0.8rem !important;
    }
    /* the single bootstrap row fills main; columns become flex so panels fill them */
    body.display-page .display-main > .row { flex: 1 1 auto; min-height: 0; margin: 0; flex-wrap: nowrap; }
    body.display-page .display-main > .row > [class*="col-"] { min-height: 0; display: flex; }
    body.display-page .hero-panel,
    body.display-page .board-panel { min-height: 0; width: 100%; }

    /* board is a flex column: head (auto) + grid (fills) + dots (auto) + foot (auto) */
    body.display-page .board-panel { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 18px; }
    body.display-page .board-head { margin-bottom: 0.35rem; flex: 0 0 auto; }
    body.display-page .pack-dots  { margin-top: 0.45rem; flex: 0 0 auto; }
    body.display-page .board-foot { margin-top: 0.45rem; margin-bottom: 0; flex: 0 0 auto; }

    body.display-page .wish-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: 1fr 1fr; }
    /* min-height:0 on the card lets the 1fr rows shrink below content; overflow clips neatly */
    /* overflow visible so the tape sticker can protrude above the card;
       the message clips instead (see .wish-msg below) to keep the no-scroll layout */
    body.display-page .wish-card { min-height: 0; overflow: visible; padding-top: 14px; padding-bottom: 10px; }
    body.display-page .wish-msg { overflow: hidden; }
    /* uploaded photos: square + centered, capped so the card never overflows */
    body.display-page .tpl-polaroid .polaroid-photo {
        aspect-ratio: 1 / 1;
        height: 56%;
        width: auto;
        max-width: 100%;
        margin: 0 auto 6px;
        flex: 0 0 auto;
    }

    body.display-page .sia-footer { margin-top: 0; padding: 10px 0; flex: 0 0 auto; }
}

/* ---------- TV / large screens ---------- */
@media (min-width: 1600px) {
    .hero-title { font-size: 4.4rem; }
    .wish-msg { font-size: 1.4rem; }
    .wish-name { font-size: 1.55rem; }
    .board-head { font-size: 2.2rem; }
}

/* ---------- Small screens ---------- */
@media (max-width: 991px) {
    .wish-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-panel { min-height: 360px; margin-bottom: 22px; }
    .hero-title { font-size: 2.8rem; }
    .board-postmark { display: none; }
}
@media (max-width: 575px) {
    .wish-grid { grid-template-columns: 1fr; }
}
