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

:root {
    --bg: #0a0a0f;
    --bg-card: rgba(255,255,255,0.03);
    --bg-card-hover: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.08);
    --text: #e4e4e7;
    --text-dim: #71717a;
    --accent: #6d5cff;
    --accent-glow: rgba(109,92,255,0.4);
    --green: #22c55e;
    --green-glow: rgba(34,197,94,0.3);
    --orange: #f97316;
    --red: #ef4444;
    --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.bg-grid {
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none; z-index: 0;
}

.bg-glow {
    position: fixed; width: 600px; height: 600px;
    border-radius: 50%; filter: blur(120px); opacity: 0.12;
    pointer-events: none; z-index: 0;
}

.bg-glow--purple { background: var(--accent); top: -200px; right: -100px; }
.bg-glow--green { background: var(--green); bottom: -200px; left: -100px; }

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

nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 14px 0;
    backdrop-filter: blur(20px);
    background: rgba(10,10,15,0.75);
    border-bottom: 1px solid var(--border);
}

nav .container { display: flex; align-items: center; justify-content: space-between; }

.logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 18px;
    text-decoration: none; color: var(--text);
}

.logo-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent), var(--green));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 10px;
    font-weight: 600; font-size: 14px;
    text-decoration: none; transition: all 0.2s;
    cursor: pointer; border: none; font-family: inherit;
}

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 0 20px var(--accent-glow); }
.btn-primary:hover { background: #5b4ce0; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card-hover); }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 12px; }
.btn-full { width: 100%; justify-content: center; }

.hero {
    padding: 140px 0 50px; text-align: center;
}

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 100px; font-size: 13px; color: var(--text-dim);
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 8px var(--green-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800; line-height: 1.1;
    margin-bottom: 20px; letter-spacing: -0.03em;
}

.hero h1 .gradient {
    background: linear-gradient(135deg, var(--accent), var(--green));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.hero p {
    font-size: 16px; color: var(--text-dim);
    max-width: 480px; margin: 0 auto; line-height: 1.7;
}

.search-section { padding: 0 0 60px; }

.search-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.search-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
}

.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }

.input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input:focus { outline: none; border-color: var(--accent); }

select.input { cursor: pointer; }

select.input option { background: #1a1a24; color: var(--text); }

.hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; display: block; }

.toggle-label {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; font-size: 14px; padding: 10px 0;
}

.toggle-input { display: none; }

.toggle-switch {
    width: 40px; height: 22px;
    background: rgba(255,255,255,0.1);
    border-radius: 11px;
    position: relative; transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    width: 16px; height: 16px;
    background: var(--text-dim);
    border-radius: 50%;
    position: absolute; top: 3px; left: 3px;
    transition: all 0.3s;
}

.toggle-input:checked + .toggle-switch { background: var(--accent); }
.toggle-input:checked + .toggle-switch::after { left: 21px; background: #fff; }

.parks-section { margin-bottom: 24px; }
.parks-section > label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 10px; }

.parks-checkboxes {
    display: flex; flex-wrap: wrap; gap: 8px;
}

.park-check {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.park-check:hover { background: var(--bg-card-hover); }
.park-check.active { background: rgba(109,92,255,0.12); border-color: rgba(109,92,255,0.3); color: #a594ff; }
.park-check input { display: none; }

.parks-actions { display: flex; gap: 8px; margin-top: 10px; }

.loading-parks { color: var(--text-dim); font-size: 13px; padding: 8px 0; }

.results-section { margin-top: 24px; }

.results-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}

.results-count { font-size: 15px; font-weight: 600; }
.results-count span { color: var(--green); }

.results-filters { font-size: 12px; color: var(--text-dim); }

.results-list { display: flex; flex-direction: column; gap: 10px; }

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    transition: all 0.2s;
    animation: fadeIn 0.3s ease;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.result-card:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.12); }

.result-img {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.result-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

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

@media (max-width: 480px) {
    .result-card { flex-direction: column; gap: 12px; padding: 14px; }
    .result-img { width: 100%; height: 160px; }
}

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

.result-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }

.result-meta {
    display: flex; flex-wrap: wrap; gap: 12px;
    font-size: 13px; color: var(--text-dim);
    margin-bottom: 10px;
}

.result-meta .date { color: var(--accent); font-weight: 500; }
.result-meta .park-name { color: var(--green); }
.result-meta .slot { color: var(--text); font-weight: 500; }
.result-meta .price { color: var(--orange); font-weight: 500; }
.result-meta .free { font-weight: 600; }
.result-meta .free.low { color: var(--red); }

.result-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--accent); font-size: 13px; font-weight: 600;
    text-decoration: none; transition: opacity 0.2s;
}
.result-link:hover { opacity: 0.8; }

.error-card {
    margin-top: 20px;
    padding: 18px 20px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 14px;
}

.no-results {
    text-align: center; padding: 40px 20px;
    color: var(--text-dim); font-size: 15px;
}

.no-results .emoji { font-size: 40px; margin-bottom: 12px; }

.hidden { display: none !important; }

.parks-info { padding: 80px 0; }
.section-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 12px; }
.section-title { font-size: clamp(24px, 3.5vw, 36px); font-weight: 700; margin-bottom: 12px; letter-spacing: -0.02em; }
.section-desc { color: var(--text-dim); font-size: 15px; }

.parks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px; margin-top: 36px;
}

.park-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    display: flex; align-items: center; gap: 12px;
    transition: all 0.2s;
}

.park-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.park-emoji { font-size: 24px; }
.park-name { font-weight: 600; font-size: 14px; }
.park-count { font-size: 12px; color: var(--text-dim); }

.features { padding: 60px 0 80px; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all 0.3s;
}

.feature-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); }

.feature-icon {
    width: 44px; height: 44px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 16px;
}

.feature-icon--purple { background: rgba(109,92,255,0.12); }
.feature-icon--green { background: rgba(34,197,94,0.12); }
.feature-icon--orange { background: rgba(249,115,22,0.12); }

.feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

footer {
    border-top: 1px solid var(--border);
    padding: 28px 0; text-align: center;
    color: var(--text-dim); font-size: 13px;
}

footer a { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--text); }

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    cursor: zoom-out;
    animation: fadeIn .15s ease;
}

.lightbox.active { display: flex; }

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    object-fit: contain;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.toasts {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.toast {
    background: rgba(20,20,30,0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 5.7s forwards;
    pointer-events: auto;
    cursor: pointer;
}

.toast:hover { border-color: rgba(255,255,255,0.15); }

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.toast-icon--freed { background: rgba(34,197,94,0.15); }
.toast-icon--taken { background: rgba(239,68,68,0.15); }

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

.toast-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-title--freed { color: var(--green); }
.toast-title--taken { color: #fca5a5; }

.toast-detail {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-time {
    font-size: 11px;
    color: var(--text-dim);
    flex-shrink: 0;
    margin-top: 2px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@media (max-width: 480px) {
    .toasts { right: 10px; left: 10px; max-width: none; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding: 120px 0 30px; }
    .search-card { padding: 20px; }
    .parks-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
