@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;400;600;700;900&family=Manrope:wght@300;400;500;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #FDFBF7;
    --fg: #1C1917;
    --primary: #EA580C;
    --primary-hover: #C2410C;
    --card: #FFFFFF;
    --border: #E7E5E4;
    --muted: #78716C;
    --muted-light: #A8A29E;
    --accent-bg: #F5F5F4;
    --orange-50: #FFF7ED;
    --orange-100: #FFEDD5;
    --orange-200: #FED7AA;
    --orange-700: #C2410C;
    --stone-50: #FAFAF9;
    --stone-100: #F5F5F4;
    --stone-200: #E7E5E4;
    --stone-300: #D6D3D1;
    --stone-400: #A8A29E;
    --stone-500: #78716C;
    --stone-700: #44403C;
    --stone-800: #292524;
    --stone-900: #1C1917;
    --radius: 12px;
}

body {
    font-family: "Manrope", "DM Sans", sans-serif;
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.font-heading { font-family: "Fraunces", "Playfair Display", serif; }

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--stone-900);
    text-align: center;
}
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0.3;
    background-image: url('https://images.pexels.com/photos/3184183/pexels-photo-3184183.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940');
}
.hero-content {
    position: relative;
    padding: 48px 24px 40px;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(234,88,12,0.2); color: #FDBA74;
    border-radius: 999px; padding: 6px 16px;
    font-size: 14px; font-weight: 700;
    margin-bottom: 16px;
}
.hero-badge svg { width: 16px; height: 16px; }
.hero h1 {
    font-family: "Fraunces", serif;
    font-size: 2.25rem; font-weight: 900;
    color: white; line-height: 1.05;
    letter-spacing: -0.02em; margin-bottom: 12px;
}
.hero p { color: var(--stone-300); font-size: 1rem; max-width: 300px; margin: 0 auto; }
.hero .sub-text { color: var(--stone-400); font-size: 0.875rem; margin-top: 8px; }

/* Container */
.container { max-width: 448px; margin: 0 auto; padding: 32px 24px; }
.container-wide { max-width: 1152px; margin: 0 auto; padding: 32px 16px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: "Manrope", sans-serif; font-weight: 700; font-size: 1rem;
    border: none; cursor: pointer; border-radius: var(--radius);
    transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.btn:active { transform: scale(0.95); }
.btn-primary {
    background: var(--primary); color: white;
    height: 56px; width: 100%; font-size: 1.125rem;
    border: 2px solid black;
    box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
    letter-spacing: 0.025em;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(2px); box-shadow: 2px 2px 0px 0px rgba(0,0,0,1); }
.btn-secondary {
    background: white; color: var(--stone-900);
    border: 2px solid var(--stone-200); height: 48px;
    padding: 0 20px; font-size: 0.875rem;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost {
    background: transparent; color: var(--stone-400);
    height: 40px; padding: 0 12px; font-size: 0.875rem;
}
.btn-ghost:hover { color: var(--primary); background: var(--stone-100); }
.btn-small { height: 40px; padding: 0 16px; font-size: 0.875rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; background: transparent; }
.btn-icon:hover { background: var(--stone-100); }
.btn-flex { flex: 1; }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--stone-100);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.card-content { padding: 20px; }

/* Form elements */
.form-group { margin-bottom: 40px; }
.form-label {
    display: block; font-size: 1rem; font-weight: 700;
    color: var(--stone-800); margin-bottom: 12px;
}
.form-input, .form-textarea {
    width: 100%; height: 48px;
    background: white; border: 2px solid var(--stone-200);
    border-radius: 8px; padding: 0 16px;
    font-family: "Manrope", sans-serif; font-size: 1rem;
    color: var(--fg); transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--stone-300); }
.form-input:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234,88,12,0.15);
}
.form-textarea {
    height: auto; min-height: 120px;
    padding: 16px; resize: none;
}

/* Rating dots */
.rating-group { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.rating-dot {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; cursor: pointer;
    transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
    border: 2px solid var(--stone-200); background: white;
    color: var(--muted); user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.rating-dot:active { transform: scale(0.92); }
.rating-dot.active {
    background: var(--primary); border-color: var(--primary);
    color: white; box-shadow: 0 2px 8px rgba(234,88,12,0.3);
}
.rating-labels { display: flex; justify-content: space-between; padding: 0 4px; }
.rating-labels span { font-size: 0.75rem; color: var(--stone-400); }

/* Portion cards */
.portion-group { display: grid; gap: 12px; }
.portion-card {
    padding: 16px 20px; border: 2px solid var(--stone-200);
    border-radius: var(--radius); cursor: pointer;
    transition: all 0.2s; background: white;
    display: flex; align-items: center; gap: 12px;
    -webkit-tap-highlight-color: transparent;
}
.portion-card:active { transform: scale(0.97); }
.portion-card.active { border-color: var(--primary); background: var(--orange-50); }
.portion-icon {
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--stone-100); color: var(--stone-500);
    transition: all 0.2s;
}
.portion-card.active .portion-icon { background: var(--primary); color: white; }
.portion-label { font-weight: 700; font-size: 0.875rem; color: var(--stone-800); }
.portion-card.active .portion-label { color: var(--orange-700); }
.portion-desc { font-size: 0.75rem; color: var(--stone-400); }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 32px; }
.stat-card { display: flex; align-items: center; gap: 12px; }
.stat-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 20px; height: 20px; color: white; }
.stat-icon.orange { background: var(--primary); }
.stat-icon.amber { background: #F59E0B; }
.stat-icon.stone { background: var(--stone-700); }
.stat-icon.teal { background: #0D9488; }
.stat-label {
    font-size: 0.625rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--stone-400);
}
.stat-value { font-family: "Fraunces", serif; font-size: 1.5rem; font-weight: 900; color: var(--stone-900); }

/* Shareable link box */
.link-box {
    background: var(--stone-50); border-radius: 8px;
    padding: 12px; margin-bottom: 12px;
}
.link-box-label {
    font-size: 0.625rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--stone-400); margin-bottom: 4px;
}
.link-row { display: flex; align-items: center; gap: 8px; }
.link-code {
    font-size: 0.75rem; color: var(--orange-700);
    font-family: monospace; background: var(--orange-50);
    padding: 4px 8px; border-radius: 4px;
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Tags */
.tag {
    display: inline-block; background: var(--orange-50);
    color: var(--orange-700); padding: 6px 12px;
    border-radius: 8px; font-size: 0.875rem; font-weight: 700;
}

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--stone-100); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.tab {
    flex: 1; height: 40px; border: none; background: transparent;
    border-radius: 8px; font-family: "Manrope", sans-serif;
    font-weight: 700; font-size: 0.875rem; cursor: pointer;
    color: var(--muted); transition: all 0.2s;
}
.tab.active { background: white; color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Progress bar */
.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress-icon {
    width: 32px; height: 32px; background: var(--stone-100);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.progress-icon svg { width: 16px; height: 16px; color: var(--stone-500); }
.progress-info { flex: 1; }
.progress-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.progress-label { font-size: 0.875rem; font-weight: 700; color: var(--stone-700); }
.progress-count { font-size: 0.75rem; color: var(--stone-400); }
.progress-bar { height: 8px; background: var(--stone-100); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: #F97316; border-radius: 999px; transition: width 0.5s; }

/* Feedback card */
.fb-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.fb-title { font-family: "Fraunces", serif; font-size: 1.125rem; font-weight: 900; color: var(--stone-900); }
.fb-date { font-size: 0.75rem; color: var(--stone-400); margin-top: 4px; }
.fb-ratings { display: flex; gap: 16px; margin-bottom: 12px; }
.fb-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 8px; font-size: 0.875rem; font-weight: 700;
}
.fb-badge.food { background: var(--orange-50); color: var(--orange-700); }
.fb-badge.theme { background: var(--stone-50); color: var(--stone-700); }
.fb-badge svg { width: 16px; height: 16px; }
.fb-badge .small-text { font-size: 0.75rem; font-weight: 400; opacity: 0.7; }
.fb-section-label {
    font-size: 0.625rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--stone-400); margin-bottom: 2px;
}
.fb-section-text { font-size: 0.875rem; color: var(--stone-700); margin-bottom: 8px; }

/* Sticky header */
.sticky-header {
    background: white; border-bottom: 1px solid var(--stone-200);
    position: sticky; top: 0; z-index: 10;
}
.header-inner {
    max-width: 1152px; margin: 0 auto;
    padding: 16px; display: flex;
    align-items: center; justify-content: space-between;
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-title { font-family: "Fraunces", serif; font-size: 1.25rem; font-weight: 900; color: var(--stone-900); }
.header-subtitle { font-size: 0.75rem; color: var(--stone-400); }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Event list items */
.event-item {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; transition: border-color 0.2s;
}
.event-item:hover { border-color: var(--orange-200); }
.event-name { font-family: "Fraunces", serif; font-size: 1.125rem; font-weight: 900; color: var(--stone-900); }
.event-meta { font-size: 0.75rem; color: var(--stone-400); margin-top: 2px; }
.chevron { width: 20px; height: 20px; color: var(--stone-300); flex-shrink: 0; margin-left: 12px; }

/* Action row */
.action-row { display: flex; gap: 8px; }

/* Not found page */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.icon-circle {
    width: 80px; height: 80px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
}
.icon-circle.orange { background: var(--orange-100); }
.icon-circle.stone { background: var(--stone-100); }
.icon-circle svg { width: 40px; height: 40px; }

/* Create form */
.create-form { border: 2px solid var(--orange-200) !important; }
.create-form .form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 12px; }

/* Dropdown menu */
.dropdown { position: relative; }
.dropdown-menu {
    display: none; position: absolute; right: 0; top: 100%;
    background: white; border: 1px solid var(--stone-200);
    border-radius: 8px; padding: 4px; min-width: 160px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 20;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 4px;
    font-size: 0.875rem; cursor: pointer;
    border: none; background: none; width: 100%;
    font-family: "Manrope", sans-serif; color: var(--fg);
}
.dropdown-item:hover { background: var(--stone-50); }
.dropdown-item.danger { color: #DC2626; }
.dropdown-item svg { width: 16px; height: 16px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate { animation: slideUp 0.5s cubic-bezier(0.22,1,0.36,1) forwards; opacity: 0; }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.1s; }
.d3 { animation-delay: 0.15s; } .d4 { animation-delay: 0.2s; }
.d5 { animation-delay: 0.25s; } .d6 { animation-delay: 0.3s; }
.d7 { animation-delay: 0.35s; }

/* Spinner */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--primary); border-top-color: transparent;
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* Toast */
.toast-container {
    position: fixed; top: 16px; left: 50%;
    transform: translateX(-50%); z-index: 100;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--stone-900); color: white;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.875rem; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
    max-width: 320px; text-align: center;
}
.toast.error { background: #DC2626; }
.toast.success { background: #16A34A; }

/* Hide utility */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--stone-300); border-radius: 99px; }
