/* ════════════════════════════════════════════════════════════════
   EventBev — The DIY Wedding Bar Calculator
   Elegant celebration palette: champagne, plum, gold, blush
   ════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─── */
:root {
    /* Core palette */
    --champagne:       #F5F0E8;
    --ivory:           #FDFBF7;
    --plum:            #6B2D5B;
    --plum-deep:       #4A1E3F;
    --plum-light:      #8B4D7B;
    --gold:            #C9A84C;
    --gold-light:      #E0C97A;
    --gold-dark:       #A68A35;
    --blush:           #E8C4C4;
    --blush-light:     #F2DEDE;
    --rose:            #D4A0A0;
    --sage:            #8FAE8B;
    --sage-dark:       #6B8E68;
    --coral:           #E07A5F;
    --coral-dark:      #C4603F;

    /* UI colors */
    --text-primary:    #2C1A24;
    --text-secondary:  #6B5560;
    --text-muted:      #9B8A92;
    --border:          rgba(107, 45, 91, 0.12);
    --border-strong:   rgba(107, 45, 91, 0.25);
    --shadow-sm:       0 2px 8px rgba(107, 45, 91, 0.08);
    --shadow-md:       0 4px 20px rgba(107, 45, 91, 0.12);
    --shadow-lg:       0 8px 40px rgba(107, 45, 91, 0.16);
    --shadow-gold:     0 4px 24px rgba(201, 168, 76, 0.25);

    /* Glass */
    --glass-bg:        rgba(253, 251, 247, 0.72);
    --glass-border:    rgba(201, 168, 76, 0.2);
    --glass-blur:      16px;

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Typography */
    --font-heading:  'Playfair Display', Georgia, serif;
    --font-body:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:     'JetBrains Mono', 'SF Mono', monospace;

    /* Radius */
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --radius-xl:  28px;

    /* Transitions */
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 0.3s var(--ease-out);
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--champagne);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Linen texture background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(232, 196, 196, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(201, 168, 76, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 0%, rgba(107, 45, 91, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Champagne Bubbles ─── */
.bubbles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(201, 168, 76, 0.3),
        rgba(201, 168, 76, 0.08));
    animation: bubble-rise linear infinite;
    will-change: transform;
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-110vh) translateX(var(--drift, 40px)) scale(0.4);
        opacity: 0;
    }
}

/* ─── Header ─── */
#site-header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: var(--space-xl) var(--space-md) var(--space-lg);
    background: linear-gradient(180deg,
        rgba(107, 45, 91, 0.06) 0%,
        transparent 100%);
}

.header-inner {
    max-width: 700px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(201, 168, 76, 0.3));
    animation: gentle-float 4s ease-in-out infinite;
}

@keyframes gentle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--plum);
    letter-spacing: -0.5px;
}

.logo .accent {
    color: var(--gold);
}

.tagline {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-top: var(--space-xs);
    letter-spacing: 0.3px;
}

/* ─── Main Content ─── */
#main-content {
    position: relative;
    z-index: 5;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-md) var(--space-2xl);
}

.section {
    margin-bottom: var(--space-xl);
}

/* ─── Intro ─── */
.intro-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto var(--space-lg);
    line-height: 1.7;
}

.intro-text em {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── Glass Card ─── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition);
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
}

/* ─── Section Titles ─── */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--plum);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-icon {
    font-size: 1.3rem;
}

.section-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.optional-badge {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gold-dark);
    background: rgba(201, 168, 76, 0.15);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: var(--space-sm);
    vertical-align: middle;
}

/* ─── Input Grid ─── */
.input-grid {
    display: grid;
    gap: var(--space-md);
}

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

.basics-grid .input-group:last-child {
    grid-column: 1 / -1;
}

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

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

.sub-split-grid {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ─── Input Group ─── */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.input-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.rate-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

input[type="number"],
select {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--ivory);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}

select {
    font-family: var(--font-body);
    cursor: pointer;
    appearance: auto;
}

/* ─── Percentage Input ─── */
.pct-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pct-input {
    padding-right: 32px !important;
}

.pct-suffix {
    position: absolute;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* ─── Price Input ─── */
.price-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.price-input-wrap input {
    padding-left: 28px !important;
}

.price-prefix {
    position: absolute;
    left: 12px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

/* ─── Profile Dots ─── */
.profile-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.profile-dot.heavy    { background: var(--plum); }
.profile-dot.moderate { background: var(--gold); }
.profile-dot.light    { background: var(--blush); }
.profile-dot.none     { background: var(--text-muted); }

/* ─── Profile Total Bar ─── */
.profile-total-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(143, 174, 139, 0.1);
    border: 1.5px solid rgba(143, 174, 139, 0.3);
    margin-bottom: var(--space-lg);
    transition: all var(--transition);
}

.profile-total-bar.invalid {
    background: rgba(224, 122, 95, 0.1);
    border-color: rgba(224, 122, 95, 0.4);
}

.profile-total-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-total-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--sage-dark);
    transition: color var(--transition);
}

.profile-total-bar.invalid .profile-total-value {
    color: var(--coral-dark);
}

.profile-total-icon {
    font-size: 1rem;
    transition: all var(--transition);
}

.profile-total-bar.invalid .profile-total-icon {
    color: var(--coral);
}

/* ─── Category Toggles ─── */
.category-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.toggle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: var(--ivory);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    user-select: none;
    position: relative;
}

.toggle-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-card.active {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
    box-shadow: var(--shadow-gold);
}

.toggle-card:not(.active) {
    opacity: 0.5;
}

.toggle-card:hover {
    transform: translateY(-2px);
}

.toggle-emoji {
    font-size: 1.8rem;
    line-height: 1;
}

.toggle-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.toggle-split {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold-dark);
    background: rgba(201, 168, 76, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
}

/* ─── Wine Sub-Split ─── */
.sub-split {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.sub-split-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--plum-light);
    margin-bottom: var(--space-md);
}

.sub-split.hidden {
    display: none;
}

/* ─── Ad Placeholders ─── */
.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    background: rgba(201, 168, 76, 0.04);
    margin: var(--space-lg) auto;
}

.ad-mobile {
    width: 320px;
    height: 50px;
    max-width: 100%;
}

.ad-desktop {
    display: none;
    width: 728px;
    height: 90px;
    max-width: 100%;
}

/* ─── Summary Bar ─── */
.summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    background: linear-gradient(135deg, var(--plum) 0%, var(--plum-deep) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    box-shadow: var(--shadow-lg);
    color: #fff;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    font-weight: 600;
}

.summary-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.summary-value.cost {
    color: var(--gold-light);
}

.summary-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
}

.summary-actions {
    margin-left: auto;
}

/* Share button */
.btn-share {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--plum);
    background: var(--gold-light);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-share:hover {
    background: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.4);
}

.btn-share:active {
    transform: translateY(0);
}

.share-icon {
    font-size: 1rem;
}

/* ─── Shopping Grid ─── */
.results-title {
    text-align: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-xl);
}

.shopping-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

/* ─── Shopping Card ─── */
.shopping-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    transition: all var(--transition);
    opacity: 0;
    transform: translateY(20px);
    animation: card-enter 0.5s var(--ease-out) forwards;
}

.shopping-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

@keyframes card-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-icon {
    font-size: 2.6rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.card-body {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--plum);
    margin-bottom: var(--space-xs);
}

.card-quantity {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-unit {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: var(--space-xs);
}

.card-detail {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.card-cost {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold-dark);
    margin-top: var(--space-sm);
    background: rgba(201, 168, 76, 0.1);
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

/* Sub-type list within a card (e.g., wine red/white/rosé) */
.card-subtypes {
    margin-top: var(--space-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.subtype-chip {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--plum-light);
    background: rgba(107, 45, 91, 0.06);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(107, 45, 91, 0.1);
}

/* ─── Timeline Chart ─── */
.timeline-chart {
    width: 100%;
    overflow-x: auto;
    padding: var(--space-md) 0;
}

.timeline-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

.timeline-bar {
    transition: all 0.4s var(--ease-out);
}

.timeline-bar:hover {
    opacity: 0.85;
}

.timeline-label {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--text-secondary);
}

.timeline-value {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--text-primary);
    font-weight: 600;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--plum);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s var(--ease-out);
    pointer-events: none;
    white-space: nowrap;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ─── Footer ─── */
#site-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≥ 600px)
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
    .shopping-grid {
        grid-template-columns: 1fr 1fr;
    }

    .category-toggles {
        grid-template-columns: repeat(4, 1fr);
    }

    .summary-actions {
        margin-left: 0;
    }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — DESKTOP (≥ 768px)
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
    .logo h1 {
        font-size: 3rem;
    }

    .logo-icon {
        font-size: 2.8rem;
    }

    .tagline {
        font-size: 1.15rem;
    }

    .glass-card {
        padding: var(--space-2xl);
    }

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

    .basics-grid .input-group:last-child {
        grid-column: auto;
    }

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

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

    .ad-mobile {
        display: none;
    }

    .ad-desktop {
        display: flex;
    }

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

    .summary-bar {
        flex-wrap: nowrap;
    }

    .summary-value {
        font-size: 2rem;
    }

    .shopping-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .card-subtypes {
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — LARGE DESKTOP (≥ 1024px)
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
    #main-content {
        max-width: 1000px;
    }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .bubble {
        display: none;
    }
}
