@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;600&display=swap');

:root {
    /* Animation Variables */
    --ease-awakening: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-awakening: 1.2s;
    /* Mixed Theme : Dark Background but Light Components where needed */
    --bg-color: #050505;

    /* Restored Light Theme Colors for Cards */
    /* Earth Tone Theme */
    --primary-color: #626F47;
    --primary-light: #A4B465;
    --accent-color: #F0BB78;
    --bg-cream: #F5ECD5;

    /* Aliases */
    --sage-dark: var(--primary-color);
    --sage-light: var(--primary-light);
    --warm-orange: var(--accent-color);

    --text-color: #2D3436;
    --text-muted: #636e72;

    /* New Variables for Background */
    --bg-dark: #050505;

    /* Legacy variables mapping */
    --sidebar-width: 380px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.1);
    --radius-l: 24px;
    --radius-m: 16px;
    --radius-s: 12px;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
}

.font-outfit {
    font-family: 'Outfit', sans-serif;
}

/* Custom Bezier for the Awakening Transition */
.awakening-transition {
    transition: all 1200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Login / Signup Page Design (City Awakening Background + Original Card) --- */
body:not(.app-layout) {
    background-color: #0a0a0c;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
}

/* Background container (Kept) */
#root-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0a0a0c;
    z-index: 0;
}

/* ... Background animation classes preserved via unchanged lines or re-included if needed ... */
/* NOTE: In multi_replace, I should be careful not to overwrite the background styles I just added. 
   But here I am using replace_file_content on a block.
   The block I am replacing includes everything from body:not(.app-layout) down to .auth-footer.
   I need to INCLUDE the background styles in this replacement to preserve them, 
   OR target only the Card styles if they were separate.
   They are intermingled in previous edit. 
   I will paste the Background CSS back in, then the Restored Card CSS.
*/

.bg-layer-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;

    /* Initial State: Blurry & Dark */
    filter: blur(20px) brightness(0.6);
    transform: scale(1.1);
    /* Slight zoom for depth */

    transition: filter 2.5s var(--ease-awakening), transform 2.5s var(--ease-awakening);

    /* Using a high-res city aerial shot (e.g. Tokyo/NYC night) */
    background-image: url('https://images.unsplash.com/photo-1503899036084-c55cdd92da26?auto=format&fit=crop&q=80&w=2400');
    z-index: 0;
}

/* State when "Awakening" (Login Clicked) */
body.awakening .bg-layer-map {
    filter: blur(0px) brightness(1.0);
    transform: scale(1.0);
}

.bg-layer-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    /* Dark mask */
    transition: opacity 2s var(--ease-awakening);
    z-index: 1;
}

body.awakening .bg-layer-mask {
    opacity: 0;
    /* Remove mask on awaken */
}

/* Vaporize Effect for Card */
/* "Water Mist" Dissipation */
@keyframes vaporize {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    100% {
        opacity: 0;
        transform: scale(1.15) translateY(-20px);
        filter: blur(20px) brightness(2);
        /* Brighter flash */
    }
}

.auth-card.vaporizing {
    animation: vaporize 1.0s var(--ease-awakening) forwards;
    pointer-events: none;
}

.bg-layer-lights {
    position: absolute;
    inset: 0;
    transition: opacity 1800ms;
    opacity: 1;
}

.light-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.light-1 {
    top: 10%;
    left: 20%;
    width: 50vw;
    height: 50vw;
    background: rgba(37, 99, 235, 0.1);
}

.light-2 {
    bottom: 10%;
    right: 20%;
    width: 40vw;
    height: 40vw;
    background: rgba(99, 102, 241, 0.1);
    animation-delay: 700ms;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

.bg-layer-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: all 2000ms;
    opacity: 0.4;
    transform: scale(1.1);
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

.bg-layer-scan {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.02), transparent);
    height: 8px;
    width: 100%;
    animation: scan 4s linear infinite;
    display: block;
}

@keyframes scan {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100vh);
    }
}

.bg-layer-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

/* === RESTORED ORIGINAL CARD STYLES === */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    /* Original Light Background */
    padding: 3rem;
    border-radius: var(--radius-l);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: none;
    /* Remove dark mode border */
}

/* Original Header styles */
.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #5548E1;
    /* Restore Primary Color for Text */
}

.auth-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #333;
    /* Dark text for light card */
    font-weight: 800;
}

.auth-subtitle {
    color: #636e72;
    margin-bottom: 1rem;
}

/* Tabs */
.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.tab-item {
    padding: 10px 20px;
    font-weight: 600;
    color: #b2bec3;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
}

.tab-item.active {
    color: #5548E1;
    border-bottom-color: #5548E1;
}

/* Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2D3436;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    /* Icon padding */
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-s);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f9f9f9;
    color: #333;
}

.form-input:focus {
    border-color: #5548E1;
    background: white;
    box-shadow: 0 0 0 4px rgba(85, 72, 225, 0.1);
}

.input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #b2bec3;
    display: block;
    /* Restore */
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #b2bec3;
    cursor: pointer;
    display: block;
    /* Restore */
}

/* Buttons */
.btn-adventure {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s;
    background: linear-gradient(135deg, #626F47 0%, #4C5735 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(85, 72, 225, 0.3);
    margin-top: 10px;
}

.btn-adventure:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(85, 72, 225, 0.4);
}

.auth-footer {
    margin-top: 1.5rem;
    color: #636e72;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: normal;
}

.privacy-text {
    opacity: 0.8;
}

/* Vaporize Effect (Optional if we want to keep it compatible with light card) - REMOVED (Consolidated above) */


/* --- App Layout (Planner) --- */
.app-layout {
    background: #f0f2f5;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    position: absolute;
    /* Floating over map */
    top: 20px;
    bottom: 20px;
    left: 20px;
    height: auto;
    /* Override main.css height:100% to respect bottom anchor */
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.05);
    /* Slightly stronger shadow for float */
    display: flex;
    flex-direction: column;
    z-index: 20;
    padding: 24px;
    box-sizing: border-box;
    border-radius: var(--radius-m);
    /* Add radius since it's floating */
    overflow: hidden;
    /* Ensure rounded corners clip content */
}

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

.sidebar-header h2 {
    margin: 0;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.6rem;
}

.trip-card {
    background: white;
    padding: 20px;
    /* Slightly more internal padding */
    border-radius: var(--radius-m);
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.trip-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: var(--primary-light);
}

.trip-card h4 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Transition Views */
#view-trip-list,
#view-trip-detail {
    animation: slideIn 0.3s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    flex: 1;
    /* Take available space */
    overflow-y: auto;
    /* Internal scroll */
    overflow-x: hidden;
    padding: 0 12px;
    /* Add padding to inset cards effectively "retracting" borders */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Trip Detail View Container */
.trip-detail-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Occupy full sidebar height */
}

/* Detail Header */
.detail-header {
    flex-shrink: 0;
    /* Don't shrink */
    display: flex;
    align-items: center;
    padding: 0 0 20px 0;
    /* More spacing */
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    background: rgba(255, 255, 255, 0.95);
    /* Ensure solid background if sticky */
    z-index: 10;
}

.back-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    color: #6B7280;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.back-btn:hover {
    color: #111827;
    background: rgba(0, 0, 0, 0.04);
}

#currentTripName {
    font-size: 1.5rem;
    /* Larger Title */
    font-weight: 800;
    margin: 0;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

/* Day Timeline (Vertical) */
#daysContent {
    padding: 10px 5px 40px 5px;
    /* Add bottom padding for scrolling */
}

/* Day Container (Card Style) */
.day-container {
    background: white;
    border-radius: var(--radius-m);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    margin-bottom: 24px;
    /* Space between days */
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    min-height: 120px;
    /* Ensure empty days have presence */
    display: flex;
    flex-direction: column;
}

.day-container:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Day Header */
.day-header {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-header span {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Places List */
.trip-places-list {
    list-style: none;
    padding: 0;
}

.trip-places-list li {
    background: #f8f9fa;
    /* Slightly off-white to contrast with white card */
    padding: 12px 16px;
    border-radius: var(--radius-s);
    margin-bottom: 8px;
    cursor: grab;

    /* Connector Styling */
    .route-connector {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 30px;
        margin: -4px 0 -4px 20px;
        /* Indent to align with list content */
        border-left: 2px dashed #ddd;
        /* Dotted line */
        position: relative;
        z-index: 1;
        /* Behind items if overlap */
    }

    /* The button on the connector line */
    .connector-btn {
        background: white;
        border: 1px solid #ddd;
        color: #aaa;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1rem;
        transition: all 0.2s;
        margin-left: -2px;
        /* Center on line (border width 2px) */
        position: relative;
        z-index: 2;
    }

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

    .connector-btn.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
        width: auto;
        height: 24px;
        padding: 0 10px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 600;
    }

    /* Dropdown Menu for Connector */
    .connector-menu {
        position: absolute;
        background: white;
        border-radius: 8px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        padding: 5px;
        display: none;
        /* toggled via JS */
        z-index: 100;
        left: 40px;
        /* Offset from button */
        top: -10px;
    }

    .connector-option {
        padding: 6px 12px;
        cursor: pointer;
        font-size: 0.9rem;
        color: var(--text-color);
        border-radius: 4px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .connector-option:hover {
        background: #f0f2f5;
        color: var(--primary-color);
    }


    .trip-places-list li:active {
        cursor: grabbing;
    }

    .trip-places-list li.highlight {
        border-color: var(--accent-color);
        background: #f0fdff;
        transform: scale(1.02);
    }

    /* Drag Ghost */
    .sortable-ghost {
        opacity: 0.4;
        background: #e8e8e8;
    }

    /* User Profile */
    .user-profile {
        margin-top: auto;
        padding-top: 20px;
        border-top: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .avatar-circle {
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, #F0BB78 0%, #DAA55D 100%);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 1.1rem;
        margin-right: 12px;
        box-shadow: 0 4px 10px rgba(255, 94, 98, 0.3);
    }

    /* Map */
    .map-container {
        position: relative;
        width: 100%;
        /* Fill full width */
        height: 100%;
        overflow: hidden;
        /* Flex child logic is moot if sidebar is absolute, but good to keep */
        display: flex;
        flex-direction: column;
    }

    #map {
        flex: 1;
        width: 100%;
        height: 100%;
    }

    .map-search-box {
        position: absolute;
        top: 35px;
        left: 430px;
        width: 280px;
        padding: 16px 20px;
        border: none;
        border-radius: 30px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        font-size: 1rem;
        font-family: 'Outfit', sans-serif;
        outline: none;
        transition: all 0.3s;
        z-index: 5;
    }

    .map-search-box:focus {
        width: 300px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }

    /* Modal */
    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(4px);
    }

    .modal-content {
        background-color: #fff;
        padding: 30px;
        border-radius: var(--radius-l);
        width: 90%;
        max-width: 420px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
        position: relative;
        animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes modalPop {
        from {
            opacity: 0;
            transform: scale(0.9);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .close {
        position: absolute;
        right: 25px;
        top: 20px;
        font-size: 28px;
        font-weight: bold;
        color: #ccc;
        cursor: pointer;
        transition: color 0.2s;
    }

    .close:hover {
        color: #333;
    }
}

/* --- Route Options Modal --- */
.segment-block {
    margin-bottom: 15px;
}

.route-option {
    transition: background-color 0.2s, transform 0.1s;
    cursor: pointer;
}

.route-option:hover {
    background-color: #f1f3f5 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    vertical-align: middle;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    padding: 0.75rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

/* ==================== Sidebar Redesign (Image 2) ==================== */

.sidebar-header-redesign {
    padding: 10px 10px 20px 10px;
}

/* Date Pill */
.date-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #F3F4F6;
    border-radius: 16px;
    font-size: 0.9rem;
    color: #6B7280;
    font-weight: 700;
    /* Bolder font */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

/* Main Action Button (Dark Sage) */
.btn-main-action {
    width: 100%;
    background: #556042;
    /* Matching dark sage */
    color: white;
    padding: 16px;
    border-radius: 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(85, 96, 66, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    border: none;
}

.btn-main-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(85, 96, 66, 0.3);
    background: #485238;
}

/* Secondary Action Grid */
.sidebar-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.action-card-btn {
    background: white;
    border: 2px solid #F3F4F6;
    /* Subtle border */
    border-radius: 20px;
    /* Rounded corners */
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    position: relative;
    /* For badge */
    font-weight: 700;
    color: #9CA3AF;
    /* Muted text default */
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
}

.action-card-btn i {
    font-size: 1.1rem;
    color: #D1D5DB;
    /* Light icon default */
    transition: color 0.2s;
}

/* Hover State */
.action-card-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: white;
}

/* Checklist Hover Specifics */
.action-card-btn.btn-checklist:hover i {
    color: #626F47;
}

.action-card-btn.btn-checklist:hover {
    color: #374151;
}

/* Notes Hover Specifics */
.action-card-btn.btn-notes:hover i {
    color: #626F47;
}

.action-card-btn.btn-notes:hover {
    color: #374151;
}


/* Badge */
.badge-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #6366F1;
    /* Indigo/Blue */
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
    border: 2px solid white;
}

/* Back Button Pill */
.btn-back-pill {
    background: #F3F4F6;
    color: #9CA3AF;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-back-pill:hover {
    background: #E5E7EB;
    color: #374151;
}