:root {
    --bg: #0f172a;
    --card: #1e293b;
    --card-hover: #273449;
    --border: #334155;
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.3);
    --success: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;
    --radius: 16px;
    --radius-sm: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.app {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 40px 0 32px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.logo { font-size: 28px; }

.brand-text {
    font-size: 18px;
    color: var(--text-dim);
}

.brand-text strong {
    color: var(--accent);
}

.hero h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.lang-switch {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-dim);
}
.lang-switch a {
    color: var(--text-dim);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}
.lang-switch a.active {
    color: var(--accent);
    font-weight: 600;
}
.lang-switch a:hover { color: var(--accent); }

/* Planner Card */
.planner-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: #475569;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Tags */
.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.tag-btn input { display: none; }

.tag-btn:hover {
    border-color: var(--accent);
}

.tag-btn.selected {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-card {
    text-align: center;
    padding: 40px;
}

.loading-animation {
    font-size: 36px;
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.loading-animation span {
    animation: bounce 0.8s ease-in-out infinite;
}

.loading-animation span:nth-child(1) { animation-delay: 0s; }
.loading-animation span:nth-child(2) { animation-delay: 0.15s; }
.loading-animation span:nth-child(3) { animation-delay: 0.3s; }
.loading-animation span:nth-child(4) { animation-delay: 0.45s; }

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

.loading-card p {
    font-size: 18px;
    font-weight: 600;
}

.loading-hint {
    font-size: 14px !important;
    color: var(--text-dim);
    margin-top: 8px;
    font-weight: 400 !important;
}

/* Result */
.result {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.result-header h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.result-header p {
    color: var(--text-dim);
    font-size: 15px;
}

.trip-timeline {
    margin: 20px 0;
}

.day-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.day-card h3 {
    font-size: 16px;
    color: var(--accent);
    margin-bottom: 10px;
}

.day-section {
    margin-bottom: 8px;
}

.day-section .section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.day-section ul {
    list-style: none;
    padding: 0;
}

.day-section li {
    padding: 4px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.day-section li:last-child { border-bottom: none; }

.hidden-gem {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 13px;
}

.hidden-gem .gem-label {
    color: var(--warn);
    font-weight: 600;
}

.result-tips {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.result-tips h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-dim);
}

.result-tips ul {
    list-style: none;
    padding: 0;
}

.result-tips li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-dim);
}

.result-tips li::before {
    content: "💡 ";
}

/* Share */
.share-section {
    margin-top: 20px;
    text-align: center;
}

.btn-share {
    padding: 12px 24px;
    background: var(--card-hover);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-share:hover {
    background: var(--accent-glow);
}

/* Footer */
footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-dim);
    font-size: 13px;
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
}

.hidden { display: none !important; }

/* Mobile */
@media (max-width: 480px) {
    .hero h1 { font-size: 26px; }
    .planner-card { padding: 20px 16px; }
    .form-row { grid-template-columns: 1fr; }
}
