/* ============================================ */
/* SafeDabei Design System                     */
/* ============================================ */

:root {
    --brand-50: #fff1f2;
    --brand-100: #ffe4e6;
    --brand-200: #fecdd3;
    --brand-300: #fda4af;
    --brand-400: #fb7185;
    --brand-500: #f43f5e;
    --brand-600: #e11d48;
    --brand-700: #be123c;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --green-500: #22c55e;
    --amber-500: #f59e0b;
    --red-500: #ef4444;
    --error: #ef4444;
    --shadow-soft: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    --shadow-float: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 12px 32px -5px rgba(0, 0, 0, 0.1);
    --shadow-nav: 0 -4px 20px -2px rgba(0, 0, 0, 0.03), 0 -1px 3px rgba(0, 0, 0, 0.02);
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-3xl: 1.5rem;
    --radius-full: 9999px;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    background: var(--gray-100);
    color: var(--gray-900);
    display: flex;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    width: 100vw;
    max-width: 100vw;
}

/* --- App Container --- */
#app-container {
    width: 100%;
    max-width: 28rem;
    background: var(--gray-50);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateZ(0);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
}

/* --- Views --- */
.app-view {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    padding-bottom: 7rem;
    height: 100%;
    width: 100%;
    scrollbar-width: none;
}
.app-view::-webkit-scrollbar { width: 0; background: transparent; }
.hide { display: none !important; }
.app-view.hide { display: none !important; }
.app-view.overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

/* --- View Transitions --- */
.view-enter {
    animation: viewSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.view-exit {
    animation: viewSlideOut 0.2s ease-in forwards;
}
@keyframes viewSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes viewSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* --- View Transitions API --- */
::view-transition-old(event-card),
::view-transition-new(event-card) {
    height: 100%;
}
::view-transition-group(event-card) {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    animation-duration: 0.4s;
}
::view-transition-group(event-title) {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    animation-duration: 0.4s;
}

/* --- Header --- */
.view-header {
    padding: 3rem 1.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 500;
}
.view-header.with-back {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.view-header .brand-tag {
    color: var(--brand-500);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}
.view-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-wrap: balance;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* --- Cards --- */
.card {
    background: white;
    border-radius: var(--radius-3xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--gray-100);
    transition: box-shadow 0.2s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow-float); }
.card:active { transform: scale(0.98); }
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.3;
    margin-bottom: 0.25rem;
    text-wrap: balance;
}
.card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.card-subtitle svg { width: 1rem; height: 1rem; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s, box-shadow 0.2s;
    font-family: inherit;
}
.btn:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}
.btn:active { transform: scale(0.95); }
.btn-primary {
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    color: white;
    padding: 1rem;
    border-radius: var(--radius-2xl);
    corner-shape: squircle;
    font-size: 1.125rem;
    box-shadow: var(--shadow-float);
    width: 100%;
}
.btn-primary:hover { 
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.4), var(--shadow-float);
}
.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-900);
    padding: 0.625rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}
.btn-secondary:hover { background: var(--gray-200); }
.btn-brand-outline {
    background: var(--brand-50);
    color: var(--brand-600);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}
.btn-brand-outline:hover { background: var(--brand-100); }
.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: var(--gray-900);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-icon svg { width: 1.5rem; height: 1.5rem; }
.btn-back {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-600);
    flex-shrink: 0;
}
.btn-back svg { width: 1.25rem; height: 1.25rem; }

/* --- Form Elements --- */
.form-group { margin-bottom: 1.5rem; }
.form-label {
    display: block;
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}
.form-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
    color: var(--gray-900);
}
.form-input:focus-visible {
    border-color: var(--brand-500);
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

/* --- Autocomplete Dropdown --- */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.25rem;
}
.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-900);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--gray-50); }
.suggestion-item.loading {
    color: var(--gray-500);
    font-style: italic;
    cursor: default;
}
.suggestion-item.error {
    color: var(--danger-500);
    cursor: default;
}
.form-input::placeholder { color: var(--gray-400); }

/* Toggle switch */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}
.toggle-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-800);
}
.toggle-sublabel {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}
.toggle-switch {
    width: 3rem;
    height: 1.75rem;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
}
.toggle-switch.active { background: var(--brand-500); }
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.25s;
}
.toggle-switch.active::after { transform: translateX(1.25rem); }

/* --- Avatars --- */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-50);
}
.avatar-sm { width: 2rem; height: 2rem; }
.avatar-md { width: 3rem; height: 3rem; }
.avatar-lg { width: 6rem; height: 6rem; border-width: 4px; }
.avatar-stack {
    display: flex;
}
.avatar-stack .avatar { margin-left: -0.5rem; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* --- RSVP Buttons --- */
.rsvp-bar {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}
.rsvp-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
}
.rsvp-btn:active { transform: scale(0.95); }
.rsvp-btn.active-going {
    border-color: var(--green-500);
    background: #f0fdf4;
    color: #16a34a;
}
.rsvp-btn.active-maybe {
    border-color: var(--amber-500);
    background: #fffbeb;
    color: #d97706;
}
.rsvp-btn.active-declined {
    border-color: var(--red-500);
    background: #fef2f2;
    color: #dc2626;
}

@property --bg-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes spin-gradient {
  to {
    --bg-angle: 360deg;
  }
}

.btn-animated-pink {
    border: 2px solid transparent !important;
    background: linear-gradient(white, white) padding-box,
                conic-gradient(from var(--bg-angle), #ff007f, #00d4ff, #ffce00, #ff007f) border-box !important;
    animation: spin-gradient 2.5s linear infinite;
    color: var(--gray-900) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.2);
}

/* --- Seat Counter --- */
.seat-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
}
.seat-counter .seat-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.seat-counter .seat-fill {
    height: 100%;
    background: var(--brand-500);
    border-radius: var(--radius-full);
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.seat-counter.full .seat-fill { background: var(--red-500); }

/* --- Assignments --- */
.assignment-list { display: flex; flex-direction: column; gap: 0.5rem; }
.assignment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    transition: all 0.2s;
}
.assignment-item.claimed { background: #f0fdf4; }
.assignment-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    background: var(--brand-100);
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.assignment-item.claimed .assignment-icon {
    background: #dcfce7;
    color: #16a34a;
}
.assignment-info { flex: 1; }
.assignment-name { font-weight: 600; font-size: 0.9rem; }
.assignment-claimer { font-size: 0.75rem; color: var(--gray-500); }
.assignment-btn {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.assignment-btn.claim {
    background: var(--brand-500);
    color: white;
}
.assignment-btn.unclaim {
    background: var(--gray-200);
    color: var(--gray-700);
}
.assignment-add {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.assignment-add input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
}
.assignment-add input:focus { border-color: var(--brand-500); }
.assignment-add button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: var(--brand-500);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.assignment-add button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* --- Chat --- */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    border-top: 1px solid var(--gray-100);
    padding-top: 1.5rem;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}
.chat-messages::-webkit-scrollbar { width: 0; }
.chat-bubble-row { display: flex; flex-direction: column; }
.chat-bubble-row.mine { align-items: flex-end; }
.chat-bubble-row.theirs { align-items: flex-start; }
.chat-meta {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--gray-400);
    margin-bottom: 0.25rem;
    margin-left: 0.25rem;
}
.chat-bubble {
    padding: 0.625rem 1rem;
    border-radius: var(--radius-2xl);
    max-width: 85%;
    font-size: 0.875rem;
    box-shadow: var(--shadow-soft);
    line-height: 1.4;
    word-break: break-word;
}
.chat-bubble.mine {
    background: var(--brand-500);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-bubble.theirs {
    background: var(--gray-100);
    color: var(--gray-800);
    border-bottom-left-radius: 4px;
}
.chat-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.chat-input {
    flex: 1;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.25rem;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-100);
}
.chat-send {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-full);
    background: var(--brand-500);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(244,63,94,0.3);
    transition: transform 0.15s;
}
.chat-send:active { transform: scale(0.9); }
.chat-send svg { width: 1.25rem; height: 1.25rem; }
.chat-empty {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
    margin-top: 3rem;
}

/* --- Bottom Nav --- */
#bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding-top: 0.5rem;
    padding-bottom: env(safe-area-inset-bottom, 1.25rem);
    z-index: 60;
    box-shadow: var(--shadow-nav);
}
#bottom-nav.hide { display: none !important; }
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    width: 4rem;
    color: var(--gray-400);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
}
.nav-btn:hover { color: var(--gray-900); }
.nav-btn.active { color: var(--brand-500); }
.nav-btn svg { width: 1.5rem; height: 1.5rem; margin-bottom: 0.25rem; }
.nav-btn span { font-size: 0.625rem; font-weight: 500; letter-spacing: 0.03em; }
.nav-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--brand-500);
    border: 2px solid white;
}

/* --- Map --- */
#map, .map-container {
    height: 200px;
    width: 100%;
    z-index: 10;
    border-radius: 0;
}
.map-picker { height: 250px; border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--gray-200); }
.custom-map-marker {
    background-color: var(--brand-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(244,63,94,0.4);
    border: 3px solid white;
}
.route-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-900);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
    margin-top: 0.75rem;
    width: 100%;
    justify-content: center;
    transition: opacity 0.2s;
    text-decoration: none;
}
.route-btn:hover { opacity: 0.9; }
.route-btn svg { width: 1.25rem; height: 1.25rem; }

/* --- Toast --- */
#toast {
    visibility: hidden;
    min-width: 250px;
    background: var(--gray-800);
    color: white;
    text-align: center;
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 100px;
    transform: translateX(-50%);
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}
#toast.show {
    visibility: visible;
    animation: toastIn 0.4s cubic-bezier(0.16,1,0.3,1), toastOut 0.4s 2.6s ease-in;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* --- Onboarding --- */
.onboarding-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}
.onboarding-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
}
.onboarding-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}
.onboarding-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
    max-width: 280px;
    line-height: 1.5;
}
.onboarding-form {
    width: 100%;
    max-width: 320px;
}
.onboarding-form .form-group { margin-bottom: 1rem; }
.onboarding-form .form-input {
    text-align: left;
    font-size: 1.125rem;
    letter-spacing: normal;
    text-transform: none;
}
.onboarding-form #join-code {
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* --- Invite Code Display --- */
.invite-code-card {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    color: white;
    border-radius: var(--radius-3xl);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px -5px rgba(244,63,94,0.3);
}
.invite-code-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    margin: 1rem 0;
    font-family: 'Inter', monospace;
}
.invite-code-label {
    font-size: 0.875rem;
    opacity: 0.85;
}

/* --- Share Link --- */
.share-link-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 0.75rem;
}
.share-link-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--gray-600);
    outline: none;
}
.share-link-box button {
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-full);
    background: var(--brand-500);
    color: white;
    border: none;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

/* --- Friends List --- */
.friend-card {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-3xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--gray-50);
}
.friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.friend-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.friend-name { font-weight: 700; color: var(--gray-900); }
.friend-network-bar {
    border-top: 1px solid var(--gray-50);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Profile --- */
.profile-card {
    background: white;
    border-radius: var(--radius-3xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    text-align: center;
}
.avatar-upload-container {
    position: relative;
    width: 6rem;
    height: 6rem;
    margin: 0 auto;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.avatar-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    color: white;
}
.avatar-upload-container:hover .avatar-upload-overlay {
    opacity: 1;
}
.avatar-upload-container:active .avatar-upload-overlay {
    background: rgba(0, 0, 0, 0.6);
}
.avatar-upload-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}
.avatar-upload-container:hover img {
    transform: scale(1.05);
}
.profile-name { font-size: 1.5rem; font-weight: 700; margin-top: 1rem; }
.profile-location { color: var(--gray-500); }
.profile-menu {
    background: white;
    border-radius: var(--radius-3xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    margin-top: 1.5rem;
}
.profile-menu-item {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
}
.profile-menu-item:hover { background: var(--gray-50); }
.profile-menu-item + .profile-menu-item { border-top: 1px solid var(--gray-50); }
.profile-menu-item.danger { color: var(--brand-500); }
.profile-menu-item svg { width: 1.25rem; height: 1.25rem; }

/* --- Network Graph --- */
#network-graph {
    position: absolute;
    inset: 0;
    outline: none;
}
.network-action-card {
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-3xl);
    box-shadow: var(--shadow-float);
    border: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
    z-index: 30;
}
.network-action-card.hidden { transform: translateY(8rem); }

/* --- Inbox Message --- */
.inbox-item {
    background: white;
    border-radius: var(--radius-3xl);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.15s;
}
.inbox-item:active { transform: scale(0.98); }
.inbox-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-full);
    background: var(--brand-100);
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.inbox-content { flex: 1; min-width: 0; }
.inbox-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.25rem; }
.inbox-title { font-weight: 700; color: var(--gray-900); }
.inbox-time { font-size: 0.75rem; color: var(--gray-400); }
.inbox-preview { font-size: 0.875rem; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Section Headers --- */
.section-title {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

/* --- Guest List --- */
.guest-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.guest-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}
.guest-name { font-weight: 500; font-size: 0.9rem; }
.guest-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    margin-left: auto;
}
.guest-badge.host { background: var(--brand-100); color: var(--brand-600); }
.guest-badge.going { background: #dcfce7; color: #16a34a; }
.guest-badge.maybe { background: #fef3c7; color: #d97706; }
.guest-badge.cohost { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }
.guest-badge.helper-role { background: #dbeafe; color: #2563eb; }
.btn-role-toggle:hover { background: var(--brand-50) !important; color: var(--brand-500) !important; transform: scale(1.15); }

/* --- Spacing / Layout Utilities --- */
.p-6 { padding: 1.5rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.relative { position: relative; }

/* --- Loading Spinner --- */
.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--brand-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 3rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-400);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state-title { font-weight: 600; color: var(--gray-600); margin-bottom: 0.5rem; }
.empty-state-text { font-size: 0.875rem; line-height: 1.5; }

/* --- Misc --- */
.divider { border-top: 1px solid var(--gray-100); margin: 1.5rem 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* --- Icon Picker --- */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.icon-picker-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.25rem;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray-500);
}
.icon-picker-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
.icon-picker-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}
.icon-picker-btn.active {
    background: var(--brand-50);
    border-color: var(--brand-500);
    color: var(--brand-600);
}
.icon-picker-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
}

/* --- Event Icon Badge in Cards --- */
.event-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-xl);
    background: var(--brand-50);
    color: var(--brand-500);
    flex-shrink: 0;
}
.event-icon-badge svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
    stroke-width: 2.25;
    fill: none;
}
.icon-picker-btn svg.svg-fill,
.event-icon-badge svg.svg-fill {
    fill: currentColor !important;
    stroke: none !important;
}
.badge-category {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.feed-accordion {
    background: white;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--gray-100);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 1rem;
    overflow: hidden;
}
.feed-accordion summary {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.feed-accordion summary::-webkit-details-marker {
    display: none; /* Hide default arrow in Safari */
}
.feed-accordion summary::after {
    content: '';
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}
.feed-accordion[open] summary::after {
    transform: rotate(180deg);
}
.feed-accordion-content {
    padding: 1.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-50);
}
.feed-accordion-content > :last-child {
    margin-bottom: 0.5rem !important;
}

/* --- Friend Info Card (Glassmorphism Slide-up Panel) --- */
.friend-info-card {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.25rem;
    border-radius: var(--radius-3xl);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
    z-index: 500;
    opacity: 1;
    transform: translateY(0);
}
.friend-info-card.hidden {
    opacity: 0;
    transform: translateY(120%) scale(0.95);
    pointer-events: none;
}
.friend-info-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--gray-100);
    color: var(--gray-500);
    border: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.friend-info-close:hover {
    background: var(--gray-200);
}
.friend-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.friend-info-meta {
    flex: 1;
}
.friend-info-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
}
.friend-info-email {
    font-size: 0.8rem;
    color: var(--gray-500);
}
.friend-info-details {
    font-size: 0.85rem;
    color: var(--gray-700);
    background: rgba(0, 0, 0, 0.02);
    padding: 0.75rem;
    border-radius: var(--radius-2xl);
    border-left: 3px solid var(--brand-500);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.friend-info-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    margin: 0.5rem auto 0;
    border: none;
    font-family: inherit;
}
.friend-info-action-btn.add {
    background: var(--brand-500);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}
.friend-info-action-btn.add:hover {
    background: var(--brand-600);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.35);
}
.friend-info-action-btn.remove {
    background: transparent;
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
}
.friend-info-action-btn.remove:hover {
    background: var(--gray-50);
    color: var(--red-500);
    border-color: var(--red-200);
}
.friend-info-action-btn svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2.5;
}

/* --- Location Picker Modal --- */
.location-modal-overlay {
    position: absolute;
    inset: 0;
    background: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    transform: translateY(0);
    opacity: 1;
}
.location-modal-overlay.hide {
    display: none !important;
}
.location-modal-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.location-modal-close-btn {
    align-self: flex-start;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: background 0.2s;
}
.location-modal-close-btn:hover {
    background: var(--gray-200);
}
.location-modal-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}
.location-modal-search-wrapper {
    display: flex;
    align-items: center;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    padding: 0.25rem 0.875rem;
    gap: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.location-modal-search-wrapper:focus-within {
    border-color: #3b82f6;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.location-modal-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    flex-shrink: 0;
}
.location-modal-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.625rem 0.25rem;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    color: var(--gray-900);
    font-family: inherit;
}
.location-modal-input::placeholder {
    color: var(--gray-400);
}
.location-modal-clear-btn {
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-shrink: 0;
    transition: color 0.2s;
}
.location-modal-clear-btn:hover {
    color: var(--gray-900);
}
.location-modal-clear-btn.hide {
    display: none !important;
}
.location-modal-results {
    margin-top: 1rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: none;
}
.location-modal-results::-webkit-scrollbar {
    width: 0;
    background: transparent;
}
.location-modal-result-item {
    display: flex;
    gap: 1rem;
    padding: 1.125rem 0.25rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: opacity 0.15s;
}
.location-modal-result-item:active {
    opacity: 0.6;
}
.location-modal-result-item-icon {
    display: flex;
    align-items: flex-start;
    padding-top: 0.125rem;
    color: var(--gray-400);
    flex-shrink: 0;
}
.location-modal-result-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.location-modal-result-item-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.3;
}
.location-modal-result-item-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.4;
}
.location-modal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* --- Dicebear Modal (Easter Egg) --- */
.dicebear-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: opacity 0.3s ease;
}

.dicebear-modal-overlay.hide {
    display: none !important;
}

.dicebear-modal-content {
    background: var(--gray-50);
    border-radius: 1.5rem 1.5rem 0 0;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.15), 0 -8px 10px -6px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0);
}

.dicebear-modal-overlay.hide .dicebear-modal-content {
    transform: translateY(100%);
}

.dicebear-modal-header {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-bottom: 2px dashed #10b981;
    padding: 1.5rem;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    cursor: default;
}

.dicebear-modal-header.dragover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-bottom-color: #047857;
    box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.2);
    transform: scale(0.995);
}

.dicebear-modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.dicebear-modal-close-btn:hover {
    background: var(--gray-300);
    color: var(--gray-900);
    transform: scale(1.05);
}

.dicebear-modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #065f46;
    max-width: 80%;
    margin: 0 auto;
    line-height: 1.4;
}

.dicebear-modal-body {
    flex: 1;
    position: relative;
    background: white;
}

.dicebear-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Hide Buy Me A Coffee widget button and its speech bubble */
#bmc-wbtn,
#bmc-wbtn + div {
    display: none !important;
}

/* --- Floating Action Button (FAB) --- */
.fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--brand-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
    border: none;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.fab:hover, .fab:active {
    transform: scale(1.05);
    background: var(--brand-600);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5);
}

.fab svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* --- Gimmick Slider --- */
.gimmick-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 100%;
    background: var(--gray-200);
    height: 24px;
    border-radius: 12px;
    outline: none;
    margin: 0.5rem auto;
    display: block;
    direction: rtl;
    box-sizing: border-box;
}

.gimmick-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    height: 36px;
    background-color: white;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><text x="8" y="30" font-size="22">👇</text></svg>');
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    border-radius: 50%;
    border: 1px solid var(--gray-300);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gimmick-slider::-moz-range-thumb {
    width: 36px;
    height: 36px;
    background-color: white;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><text x="8" y="30" font-size="22">👇</text></svg>');
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0.5;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Flyer Upload Styles */
.flyer-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem 1rem;
    text-align: center;
    background-color: var(--gray-50);
    cursor: pointer;
    transition: all 0.2s ease;
}

.flyer-upload-area:hover, .flyer-upload-area.dragover {
    border-color: var(--brand-500);
    background-color: var(--brand-50);
}

.flyer-upload-area .icon {
    font-size: 2rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.flyer-preview-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

.flyer-preview-container img {
    width: 100%;
    display: block;
}

.flyer-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

/* --- Flyer Lightbox --- */
.flyer-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: flyerLightboxIn 0.25s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.flyer-lightbox-overlay.hide {
    display: none !important;
}
@keyframes flyerLightboxIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.flyer-lightbox-overlay img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: flyerZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes flyerZoomIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.flyer-lightbox-close {
    position: absolute;
    top: env(safe-area-inset-top, 1rem);
    right: 1rem;
    margin-top: 1rem;
    width: 2.75rem;
    height: 2.75rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    backdrop-filter: blur(8px);
    transition: background 0.2s, transform 0.2s;
}
.flyer-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* --- Flyer Thumbnail in Detail View --- */
.flyer-detail-wrapper {
    margin-top: 1.5rem;
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.flyer-detail-wrapper:active {
    transform: scale(0.98);
}
.flyer-detail-wrapper img {
    width: 100%;
    display: block;
    object-fit: cover;
    max-height: 320px;
}
.flyer-detail-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    opacity: 0.85;
    pointer-events: none;
}

/* --- AI Import Button --- */
.ai-import-banner {
    position: relative;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    border-radius: var(--radius-xl);
    color: white;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ai-import-banner:active {
    transform: scale(0.98);
}
.ai-import-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    animation: aiShimmer 2.5s ease-in-out infinite;
}
@keyframes aiShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.ai-import-banner-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}
.ai-import-banner-subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.25rem;
    position: relative;
    z-index: 1;
}

/* AI Import Loading State */
.ai-import-loading {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    border-radius: var(--radius-xl);
    color: white;
    text-align: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}
.ai-import-loading .spinner {
    border-top-color: white;
    margin: 0 auto 0.75rem;
}
.ai-import-loading-text {
    font-size: 0.9rem;
    font-weight: 600;
    animation: aiPulse 1.5s ease-in-out infinite;
}
@keyframes aiPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}
