/* My Tree Story — Design System */

:root {
    --accent: #4c9182;
    --accent-dim: rgba(76, 145, 130, 0.1);
    --accent-glow: rgba(76, 145, 130, 0.25);
    --accent-hover: #3a7a6c;
    --bg: #fafaf8;
    --bg-card: #ffffff;
    --bg-dark: #0f1923;
    --text: #1a2a3a;
    --text-secondary: #6b7b8d;
    --text-light: #9ba8b4;
    --border: #e5e7eb;
    --border-focus: var(--accent);
    --success: #2d7d5f;
    --error: #dc4a3f;
    --warning: #b8760a;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1200px;
}

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

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-content { flex: 1; padding: 2rem 0; }

/* Nav */
.nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text);
    text-decoration: none;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font-body);
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 1px 4px rgba(76,145,130,0.2);
}
.btn-primary:hover { background: var(--accent-hover); color: white; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(76,145,130,0.3); }
.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.btn-secondary:hover { background: var(--accent-dim); }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--accent-dim); color: var(--accent); }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header { margin-bottom: 1rem; }
.card-title { font-family: var(--font-display); font-size: 1.1rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.375rem; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-body);
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-error { color: var(--error); font-size: 0.8rem; margin-top: 0.25rem; }

/* Grid */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-card);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.upload-zone h3 { margin-bottom: 0.5rem; color: var(--text); }
.upload-zone p { color: var(--text-secondary); font-size: 0.9rem; }

/* Stats */
.stat-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 2rem; color: var(--accent); font-weight: 400; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); }

/* Badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-free { background: var(--accent-dim); color: var(--accent); }
.badge-plus { background: #E8F5E9; color: #2E7D32; }
.badge-pro { background: #E3F2FD; color: #1565C0; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}
.empty-state h3 { margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 1.5rem; }

/* Toast */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(1rem);
    transition: all 0.3s;
    max-width: 400px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-info { background: var(--bg-card); border: 1px solid var(--border); }
.toast-success { background: #E8F5E9; border: 1px solid #C8E6C9; color: #2E7D32; }
.toast-error { background: #FFEBEE; border: 1px solid #FFCDD2; color: #C62828; }

/* Hero (for non-landing pages) */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
}
.hero h1 { font-size: 3.25rem; margin-bottom: 1rem; color: var(--text); }
.hero p { font-size: 1.2rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 2rem; }

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--text-light);
    font-size: 0.85rem;
}
.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-secondary); }

/* Map container */
#map {
    width: 100%;
    height: 500px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* Tree view */
.tree-svg { width: 100%; min-height: 600px; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); }

/* Timeline */
.timeline-container { overflow-x: auto; padding: 2rem 0; }
.timeline-event {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    padding: 0.5rem;
}
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline-year { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }
.timeline-name { font-size: 0.75rem; color: var(--text); text-align: center; }

/* Story */
.story-content { line-height: 1.8; font-size: 1.05rem; }
.story-content p { margin-bottom: 1rem; }

/* Pricing */
.pricing-card {
    text-align: center;
    padding: 2rem;
    position: relative;
}
.pricing-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg);
}
.pricing-price { font-family: var(--font-display); font-size: 2.5rem; color: var(--accent); }
.pricing-period { font-size: 0.85rem; color: var(--text-secondary); }
.pricing-features { list-style: none; text-align: left; margin: 1.5rem 0; }
.pricing-features li { padding: 0.375rem 0; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.pricing-features li::before { content: "\2713 "; color: var(--success); font-weight: bold; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    h1 { font-size: 1.75rem; }
    .nav-links { gap: 0.75rem; }
    .stat-row { justify-content: center; }
    #map { height: 350px; }
}
