/* Base Variables */
:root {
    --bg-color-main: #0B0A11;
    --bg-color-surface: #1C1929;
    --bg-color-overlay: rgba(28, 25, 41, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);

    --text-primary: #FFFFFF;
    --text-secondary: #9FA1B4;
    --text-muted: #5E627B;

    --accent-primary: #FF3366;
    --accent-primary-hover: #E62E5C;
    --accent-secondary: #00D2D3;
    --accent-glow: rgba(255, 51, 102, 0.4);

    --font-main: 'Outfit', sans-serif;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Scaffolding */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    /* Soft background gradient glow */
    background-image: radial-gradient(circle at 100% 100%, rgba(255, 51, 102, 0.15), transparent 40%),
        radial-gradient(circle at 0% 0%, rgba(0, 210, 211, 0.1), transparent 40%);
    background-attachment: fixed;
}

/* Layout */
.app-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 6rem;
    /* Space for floating bar */
}

/* Sidebar Styling */
.logo h1 {
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.logo span {
    color: var(--accent-primary);
}

.sidebar-section {
    background: var(--bg-color-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.sidebar-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.9rem;
    text-align: left;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-btn i {
    width: 16px;
    text-align: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-btn.primary {
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-primary);
    border-color: rgba(255, 51, 102, 0.2);
}

.nav-btn.primary:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Header Navbar */
.top-header {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.top-nav {
    display: flex;
    gap: 2rem;
}

.top-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.top-nav a:hover,
.top-nav a.active {
    color: var(--text-primary);
}

/* Cards & Components */
.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--bg-color-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-grid {
    display: grid;
    gap: 1.5rem;
}

.layout-2-col {
    grid-template-columns: 1fr 1fr;
}

.layout-2-col-action {
    grid-template-columns: 2fr 1fr auto;
    align-items: end;
}

.layout-3-col-action {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

label i {
    margin-right: 0.5rem;
}

.premium-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.premium-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 51, 102, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.premium-input::placeholder {
    color: var(--text-muted);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
}

.input-with-icon .premium-input {
    padding-left: 2rem;
}

/* Custom Date Inputs */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
    transition: var(--transition);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Button */
.btn-action {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    height: 46px;
    /* Match input height */
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.btn-action.primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Travel Modes Selector */
.mode-selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.mode-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.mode-card:hover {
    border-color: var(--accent-primary);
}

.mode-icon {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.mode-name {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Highlighted Sections (Already Paid) */
.highlight-card {
    border-color: rgba(0, 210, 211, 0.3);
    background: linear-gradient(145deg, var(--bg-color-surface) 0%, rgba(0, 210, 211, 0.05) 100%);
}

.accent-title {
    color: var(--accent-secondary);
}

.paid-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--accent-secondary);
}

.paid-item-info span {
    padding-right: 1rem;
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

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

/* Utilities */
.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.text-success {
    color: var(--accent-secondary);
}

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

.hint-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Double Card Layout */
.double-card-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.todo-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.todo-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.todo-item input[type="checkbox"] {
    margin-right: 1rem;
    accent-color: var(--accent-primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Timeline Components */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    padding-left: 2rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-day {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    transition: var(--transition);
}

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

.timeline-day::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 1.5rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-color-surface);
    border: 2px solid var(--accent-secondary);
    z-index: 1;
}

/* Floating Analytics Bar */
.floating-analytics-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 18, 30, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    /* Pill shape */
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.analytic-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.analytic-item .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.analytic-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.analytic-item .sub-value {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.floating-analytics-bar .divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-color-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

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

.modal-body {
    padding: 1.5rem;
}

.saved-trips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.saved-trip-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    transition: var(--transition);
}

.saved-trip-item:hover {
    border-color: var(--accent-secondary);
    background: rgba(0, 210, 211, 0.05);
}

.trip-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mini Calendar */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.calendar-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
}

.day-name {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
}

.day.date {
    padding: 0.25rem;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.day.date:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.day.date.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .sidebar,
    .top-header,
    .floating-analytics-bar,
    .modal-overlay,
    .btn-action,
    .btn-remove {
        display: none !important;
    }

    .app-container {
        max-width: 100%;
        padding: 0;
    }

    .main-content {
        padding-bottom: 0;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
        background: white;
        color: black;
    }

    .premium-input {
        border: 1px solid #ccc;
        background: white;
        color: black;
    }

    .section-title,
    .subtitle,
    label,
    .text-secondary,
    .text-muted {
        color: #333;
    }

    .text-success {
        color: #008000;
    }

    .text-accent {
        color: #D32F2F;
    }
}