:root {
    --cream: #FFF9F0;
    --chocolate: #3D2817;
    --caramel: #D4956C;
    --mint: #B8E6D5;
    --cherry: #FF6B9D;
    --vanilla: #FFEAA7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: linear-gradient(135deg, var(--cream) 0%, var(--mint) 100%);
    min-height: 100vh;
    color: var(--chocolate);
    overflow-x: hidden;
    position: relative;
}

/* Animated background elements */
.bg-decoration {
    position: fixed;
    border-radius: 50%;
    opacity: 0.15;
    pointer-events: none;
    animation: float 20s infinite ease-in-out;
}

.decoration-1 {
    width: 300px;
    height: 300px;
    background: var(--cherry);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.decoration-2 {
    width: 200px;
    height: 200px;
    background: var(--vanilla);
    bottom: 10%;
    right: -50px;
    animation-delay: 5s;
}

.decoration-3 {
    width: 250px;
    height: 250px;
    background: var(--caramel);
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 60px;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--chocolate);
    margin-bottom: 15px;
    text-shadow: 3px 3px 0 var(--mint), 6px 6px 0 var(--cherry);
    line-height: 1.1;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--chocolate);
    opacity: 0.8;
    font-weight: 500;
}

.search-button {
    background: linear-gradient(135deg, var(--cherry) 0%, var(--caramel) 100%);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.4);
    transition: all 0.3s ease;
    display: inline-block;
    margin: 30px auto;
    animation: pulse 2s infinite;
}

.selector-container {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid rgba(61, 40, 23, 0.1);
}

.selector-label {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--chocolate);
    margin-bottom: 12px;
    font-family: 'DM Sans', sans-serif;
    opacity: 0.8;
}

.flavor-select {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--chocolate);
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--mint);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(184, 230, 213, 0.2);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233D2817' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 50px;
}

.flavor-select:hover {
    border-color: var(--cherry);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.2);
    transform: translateY(-1px);
}

.flavor-select:focus {
    outline: none;
    border-color: var(--cherry);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}

.flavor-select option {
    padding: 10px;
    font-size: 1rem;
}

.flavor-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--mint);
    border-radius: 50px;
    padding: 10px 20px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
    position: relative;
    z-index: 1;
}

.flavor-pill:focus-within {
    border-color: var(--cherry);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}

.flavor-pill-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--chocolate);
    opacity: 0.65;
    flex-shrink: 0;
}

.flavor-select-inline {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--chocolate);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233D2817' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 28px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.search-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 107, 157, 0.6);
    animation: none;
}

.search-button:active  { transform: translateY(0) scale(1); }
.search-button:disabled { background: #ccc; cursor: not-allowed; animation: none; }

.loading {
    text-align: center;
    font-size: 1.2rem;
    color: var(--chocolate);
    margin: 40px 0;
    font-weight: 500;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 4px solid var(--mint);
    border-top: 4px solid var(--cherry);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    margin-top: 50px;
    animation: fadeInUp 0.6s ease;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.result-card {
    background: white;
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(61, 40, 23, 0.1);
    transition: all 0.3s ease;
    border: 3px solid transparent;
    animation: cardAppear 0.5s ease backwards;
    cursor: pointer;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }
.result-card:nth-child(5) { animation-delay: 0.5s; }
.result-card:nth-child(6) { animation-delay: 0.6s; }
.result-card:nth-child(7) { animation-delay: 0.7s; }

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(61, 40, 23, 0.15);
}

.result-card.found {
    border-color: var(--mint);
    background: linear-gradient(135deg, white 0%, var(--mint) 100%);
}

.result-card.not-found { opacity: 0.6; }

.result-card.loading {
    opacity: 0.65;
}

.status.loading {
    background: rgba(184, 230, 213, 0.4);
    color: var(--chocolate);
    opacity: 0.7;
    font-size: 0.9rem;
}

.loading-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 4px;
}

.loading-dots span {
    font-size: 1.2rem;
    animation: pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
    0%, 100% { opacity: 0.2; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 4px var(--pink)); }
}

.location-name {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--chocolate);
    margin-bottom: 10px;
}

.location-address {
    font-size: 1rem;
    color: var(--chocolate);
    opacity: 0.7;
    margin-bottom: 15px;
}

.status {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Fredoka', sans-serif;
}

.status.found {
    background: var(--cherry);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.status.not-found {
    background: #E8E8E8;
    color: #666;
}

.error {
    background: #FFE5E5;
    border: 3px solid #FF6B6B;
    border-radius: 20px;
    padding: 25px;
    margin: 30px 0;
    color: #D32F2F;
    font-weight: 500;
    font-size: 1.1rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-10px); }
    75%       { transform: translateX(10px); }
}

.summary {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    margin: 40px 0;
    padding: 30px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(61, 40, 23, 0.1);
    animation: fadeInUp 0.8s ease;
}

.summary-card {
    background: white;
    border-radius: 25px;
    padding: 20px 25px;
    box-shadow: 0 10px 40px rgba(61, 40, 23, 0.1);
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-card .flavor-pill {
    margin-bottom: 16px;
    width: 100%;
}

.summary-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--chocolate);
}

.notif-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    background: none;
    border: none;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cherry);
    cursor: pointer;
    text-decoration: none;
}

.notif-trigger:hover { opacity: 0.8; }

.notif-arrow { font-size: 0.65rem; transition: transform 0.2s; }
.notif-trigger.open .notif-arrow { transform: rotate(180deg); }

.notif-form {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    background: rgba(184, 230, 213, 0.15);
    border: 1.5px solid rgba(184, 230, 213, 0.7);
    border-radius: 16px;
    transition: max-height 0.32s ease, opacity 0.22s ease, margin-top 0.32s ease, padding 0.32s ease;
    padding: 0 16px;
}

.notif-form.open {
    max-height: 500px;
    opacity: 1;
    margin-top: 12px;
    padding: 14px 16px;
}

.notif-form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-input {
    flex: 1;
    min-width: 0;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--chocolate);
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--mint);
    border-radius: 50px;
    transition: border-color 0.2s;
}

.notif-input:focus {
    outline: none;
    border-color: var(--cherry);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}

.notif-btn {
    background: linear-gradient(135deg, var(--cherry) 0%, var(--caramel) 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.35);
    transition: all 0.2s ease;
}

.notif-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
}

.notif-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }

.notif-filter-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid var(--mint);
    color: var(--chocolate);
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.notif-filter-btn:hover { background: rgba(184, 230, 213, 0.4); border-color: var(--cherry); }
.notif-filter-btn.active { background: rgba(184, 230, 213, 0.5); border-color: var(--cherry); }

.location-filter-panel {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease;
}

.location-filter-panel.open {
    max-height: 300px;
}

.notif-hint {
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--chocolate);
    opacity: 0.55;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 0;
}

.emoji {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

/* ── Subscription banner & form ─────────────────────────────── */

.subscribed-banner {
    position: relative;
    background: #D4EDDA;
    border: 3px solid #28A745;
    border-radius: 20px;
    padding: 18px 50px 18px 25px;
    margin-bottom: 30px;
    color: #155724;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.banner-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #155724;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.7;
}

.banner-close:hover { opacity: 1; }

.subscribe-message { margin-top: 15px; font-weight: 500; }
.subscribe-message.success { color: #28A745; }
.subscribe-message.error   { color: #D32F2F; }

.subscribe-hint {
    font-size: 0.85rem;
    color: var(--chocolate);
    opacity: 0.6;
    margin: 12px 0 0 0;
    text-align: center;
}

.location-checkboxes { margin-bottom: 15px; }

.location-checkboxes summary {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--chocolate);
    opacity: 0.7;
    margin-bottom: 10px;
    user-select: none;
}

.location-checkboxes summary:hover { opacity: 1; }

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .results-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        text-shadow: 2px 2px 0 var(--mint), 4px 4px 0 var(--cherry);
    }
    .subtitle        { font-size: 1.1rem; }
    .search-button   { padding: 15px 35px; font-size: 1.1rem; }
    .location-name   { font-size: 1.5rem; }
    .results-grid    { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
    .checkbox-grid { grid-template-columns: 1fr; }
    .flavor-pill-label { display: none; }
    .flavor-pill { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .bg-decoration { animation: none; }
    .search-button { animation: none; }
    .emoji         { animation: none; }
    .spinner       { animation: spin 1s linear infinite; } /* keep — functional */
}
