/* main.css */

:root {
    --sky-top: #bdeaf9;
    --sky-mid: #e3f7ec;
    --sky-bottom: #f8fbf5;
    --green-700: #2f8a4a;
    --green-600: #3ea55e;
    --green-500: #56c271;
    --green-100: #e7f7ec;
    --yellow: #ffcf4d;
    --ink: #1f2b22;
    --ink-soft: #4b5a4f;
    --card-bg: #ffffff;
    --line: #e3ede4;
    --radius-lg: 22px;
    --radius-md: 14px;
    --shadow-sm: 0 2px 6px rgba(31, 43, 34, 0.08);
    --shadow-md: 0 8px 24px rgba(31, 43, 34, 0.12);
    --shadow-lg: 0 16px 40px rgba(31, 43, 34, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Fredoka', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bottom) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    padding-bottom: 40px;
}

/* Decorative background blobs */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
}

.blob-a {
    width: 420px;
    height: 420px;
    background: var(--green-500);
    top: -120px;
    left: -100px;
}

.blob-b {
    width: 360px;
    height: 360px;
    background: var(--yellow);
    top: 10%;
    right: -140px;
}

.blob-c {
    width: 320px;
    height: 320px;
    background: #7fd1e8;
    bottom: -80px;
    left: 30%;
}

/* Header / hero */
.hero {
    text-align: center;
    margin-top: 56px;
    padding: 0 20px;
}

.logo {
    width: 220px;
    height: auto;
    display: block;
    margin: 0 auto 4px;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    color: white;
    -webkit-text-stroke: 4px var(--green-700);
    paint-order: stroke fill;
    letter-spacing: 0.5px;
}

.hero-subtitle {
    margin-top: 10px;
    font-size: 1.05rem;
    color: var(--ink-soft);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.fix-stroke {
    paint-order: stroke fill;
}

/* Toolbar */
.toolbar {
    width: 100%;
    max-width: 900px;
    margin: 28px auto 8px;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 10px;
    z-index: 20;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 18px;
    box-shadow: var(--shadow-sm);
    flex: 1 1 260px;
    max-width: 360px;
}

.search-icon {
    color: var(--ink-soft);
    flex-shrink: 0;
}

#search {
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    width: 100%;
    color: var(--ink);
}

.chip-group {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

.chip {
    border: none;
    background: transparent;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.chip:hover {
    color: var(--green-700);
}

.chip.is-active {
    background: linear-gradient(to bottom, var(--green-500), var(--green-600));
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Main content */
main {
    width: 100%;
    max-width: 1100px;
    padding: 0 16px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 32px 8px 4px;
    color: var(--green-700);
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    padding: 12px 0 20px;
}

.card {
    position: relative;
    width: 150px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: visible;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    border: 2px solid transparent;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card.is-picked {
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px var(--green-100), var(--shadow-md);
}

.card-media {
    background: var(--green-100);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 10px;
}

.card-content {
    padding: 8px 10px 10px;
    text-align: center;
}

.card-content h3 {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
}

.pick-badge {
    display: none;
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #abee3c, #56c271);
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
    color: white;
    font-size: 15px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.card.is-picked .pick-badge {
    display: flex;
}

.card.is-hidden {
    display: none;
}

.empty-state {
    text-align: center;
    color: var(--ink-soft);
    font-size: 1.05rem;
    padding: 60px 20px;
}

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-soft);
    opacity: 0.85;
}

/* Wishlist tray */
.wishlist-tray {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, calc(100% - 2px));
    width: min(680px, 94vw);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    box-shadow: var(--shadow-lg);
    padding: 14px 18px 18px;
    z-index: 50;
    transition: transform 0.3s ease;
}

.wishlist-tray.is-visible {
    transform: translate(-50%, 0);
}

.wishlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 10px;
}

.wishlist-count {
    color: var(--green-700);
    font-weight: 700;
    margin-left: 4px;
}

.wishlist-actions {
    display: flex;
    gap: 8px;
}

.tray-btn {
    border: none;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(to bottom, var(--green-500), var(--green-600));
    color: white;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s;
}

.tray-btn:hover {
    transform: translateY(-1px);
}

.tray-btn-ghost {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    box-shadow: none;
}

.wishlist-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wishlist-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--green-100);
    border-radius: 999px;
    padding: 5px 10px 5px 5px;
    font-size: 13px;
    font-weight: 600;
}

.wishlist-chip img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
}

.wishlist-chip button {
    border: none;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px;
}

.tray-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Event registration step (inside wishlist tray) */
.wishlist-step {
    transition: opacity 0.25s ease;
}

.event-register {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

#event-username {
    flex: 1 1 200px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
    background: white;
    color: var(--ink);
}

#event-username:focus {
    border-color: var(--green-500);
}

.event-confirm-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--green-700);
    margin-bottom: 4px;
}

.event-confirm-body {
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 14px;
}

.event-join-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-join-btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.transition-spinner {
    width: 32px;
    height: 32px;
    margin: 4px auto 14px;
    border: 4px solid var(--green-100);
    border-top-color: var(--green-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.transition-message {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    min-height: 20px;
    transition: opacity 0.35s ease;
}

.transition-progress {
    width: 160px;
    height: 4px;
    margin: 12px auto 0;
    background: var(--green-100);
    border-radius: 999px;
    overflow: hidden;
}

.transition-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--green-500), var(--green-600));
    transition: width linear;
}

/* Floating decorative images */
#floating-images-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.floating-image {
    position: absolute;
    width: 90px;
    height: auto;
    opacity: 0.16;
}

@media screen and (max-width: 640px) {
    .hero h1 {
        font-size: 1.7rem;
        -webkit-text-stroke: 3px var(--green-700);
    }

    .card {
        width: 42vw;
        max-width: 160px;
    }

    .toolbar {
        position: static;
    }
}
