:root {
    /* Theme Colors (Sakura / Spring Japan) */
    --primary: #ffb7c5;
    --primary-light: #ffdbe2;
    --secondary: #e68a9d;
    --accent: #d84b6b;
    --background: #fffdfd;
    --surface: #ffffff;
    --text-main: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #bdc3c7;
    
    /* Event Type Colors */
    --type-flight: #3498db;
    --type-transit: #9b59b6;
    --type-accommodation: #e67e22;
    --type-meal: #e74c3c;
    --type-sightseeing: #2ecc71;
    --type-info: #95a5a6;

    /* Geometry */
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 30px rgba(230, 138, 157, 0.1);
    --shadow-hover: 0 15px 35px rgba(230, 138, 157, 0.2);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100vw;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(44, 62, 80, 0.6), rgba(230, 138, 157, 0.7));
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
    animation: fadeInDown 1s ease-out;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.5rem;
    font-weight: 300;
    text-shadow: 1px 1px 8px rgba(0,0,0,0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: bounce 2s infinite;
    opacity: 0.8;
}

/* --- Overview Bar --- */
.overview-bar {
    background: var(--surface);
    padding: 20px 0;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 10;
}

.overview-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary);
}

.stat i {
    font-size: 1.5rem;
    color: var(--accent);
}

/* --- Main Layout --- */
.timeline-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 40px;
}

/* --- Day Navigation --- */
.day-nav {
    flex: 0 0 250px;
    position: sticky;
    top: 40px;
    height: max-content;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.day-nav::-webkit-scrollbar {
    width: 6px;
}
.day-nav::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 10px;
}

.nav-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--primary-light);
}

.nav-item.active {
    background: var(--primary-light);
    border-left: 3px solid var(--accent);
    color: var(--accent);
}

.nav-item .nav-date {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
}

.nav-item.active .nav-date {
    color: var(--accent);
}

.nav-item .nav-title {
    font-size: 1rem;
    font-weight: 500;
}

/* --- Timeline --- */
.timeline {
    flex: 1;
}

.day-section {
    margin-bottom: 60px;
    scroll-margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.day-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.day-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-light);
}

.day-header h2 {
    font-size: 2.5rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 15px;
}

.day-header .day-meta {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 400;
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

/* --- Event Cards --- */
.events-wrapper {
    position: relative;
}

.events-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: var(--primary-light);
    z-index: 0;
}

.event-card {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.event-time-marker {
    flex: 0 0 100px;
    text-align: right;
    padding-top: 15px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
}

.event-icon {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--primary);
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Event Type Details */
.event-card[data-type="flight"] .event-icon { border-color: var(--type-flight); color: var(--type-flight); }
.event-card[data-type="transit"] .event-icon { border-color: var(--type-transit); color: var(--type-transit); }
.event-card[data-type="accommodation"] .event-icon { border-color: var(--type-accommodation); color: var(--type-accommodation); }
.event-card[data-type="meal"] .event-icon { border-color: var(--type-meal); color: var(--type-meal); }
.event-card[data-type="sightseeing"] .event-icon { border-color: var(--type-sightseeing); color: var(--type-sightseeing); }
.event-card[data-type="info"] .event-icon { border-color: var(--type-info); color: var(--type-info); }

.event-content {
    flex: 1;
    background: var(--surface);
    padding: 20px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-content:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.event-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.event-location {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-location i {
    color: var(--accent);
}

.event-description {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.5;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px 20px;
    background: var(--surface);
    margin-top: 60px;
    color: var(--text-light);
}

.edit-hint {
    margin-top: 10px;
    font-size: 0.9rem;
}

.edit-hint code {
    background: var(--primary-light);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- Animations --- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-20px) translateX(-50%); }
    60% { transform: translateY(-10px) translateX(-50%); }
}

/* --- Responsive Layout --- */
@media (max-width: 900px) {
    .timeline-container {
        flex-direction: column;
    }

    .day-nav {
        position: relative;
        top: 0;
        max-height: none;
        display: flex;
        overflow-x: auto;
        padding: 10px;
        margin-bottom: 30px;
        border-radius: var(--radius-md);
    }
    
    .nav-item {
        flex: 0 0 150px;
        margin-right: 15px;
        margin-bottom: 0;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid var(--accent);
    }

    .events-wrapper::before {
        left: 31px;
    }

    .event-card {
        flex-direction: column;
        gap: 15px;
    }

    .event-time-marker {
        text-align: left;
        padding-top: 0;
        padding-left: 60px;
    }

    .event-icon {
        position: absolute;
        left: 11px;
        top: 30px;
    }

    .event-content {
        margin-left: 60px;
    }
}

@media (max-width: 600px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-content p {
        font-size: 1.2rem;
    }

    .overview-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .day-header h2 {
        font-size: 2rem;
    }

    .event-content {
        padding: 15px;
    }
}

/* --- Editor UI & Modals --- */

.hidden {
    display: none !important;
}

/* Floating Controls */
.floating-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    border: none;
    box-shadow: var(--shadow-hover);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.float-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary);
}

.float-btn.active {
    background-color: var(--text-main);
}

.export-btn {
    background-color: var(--text-main);
}

/* Edit Actions on Cards */
.edit-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
}

.action-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.action-icon-btn:hover {
    color: var(--accent);
}

.add-event-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    border: 2px dashed var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.add-event-btn:hover {
    background: var(--primary-light);
    color: var(--accent);
    border-color: var(--accent);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44, 62, 80, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.export-modal-content {
    max-width: 700px;
}

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

.modal-header h3 {
    font-size: 1.8rem;
    color: var(--accent);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}

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

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    background: var(--background);
    transition: border-color 0.3s ease;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

.btn {
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--primary);
}

.export-instructions {
    margin-bottom: 20px;
    font-size: 1rem;
}

#export-textarea {
    width: 100%;
    font-family: monospace;
    font-size: 0.9rem;
    padding: 15px;
    border: 1px solid var(--text-muted);
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    resize: vertical;
}

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