/* --- Design System & CSS Tokens --- */
:root {
    --bg-primary: #0a0f1d;
    --card-bg: rgba(15, 23, 42, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-teal: #06b6d4;
    --accent-coral: #fb7185;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success-green: #34d399;
    --warning-orange: #fb923c;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Ambient Background Glows --- */
.bg-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}
.bg-glow-1 {
    top: 10%;
    left: -50px;
    background-color: var(--accent-teal);
}
.bg-glow-2 {
    bottom: 20%;
    right: -50px;
    background-color: var(--accent-coral);
}

/* --- Glassmorphism Card Style --- */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

/* --- Base Typography & UI elements --- */
h1, h2, h3, h4 {
    font-weight: 700;
}
p {
    font-size: 0.95rem;
    line-height: 1.5;
}
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-secondary { color: var(--text-secondary); }

/* --- Screens Lifecycle --- */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}
.screen.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Login Screen Styling --- */
#login-screen {
    justify-content: center;
    align-items: center;
}
.login-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.brand .icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 10px;
}
.brand h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #22d3ee, #f43f5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}
.brand p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.input-group {
    text-align: left;
    margin-bottom: 16px;
}
.input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}
.input-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.input-group input:focus {
    border-color: var(--accent-teal);
}
.btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #0891b2, #db2777);
    color: white;
}
.btn:active {
    transform: scale(0.98);
}
.error-msg {
    color: var(--accent-coral);
    font-size: 0.85rem;
    margin-top: 12px;
}

/* --- Main Layout Styling --- */
#app-screen {
    padding: 0 0 85px 0; /* padding bottom for bottom nav */
}
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    position: sticky;
    top: 0;
    background: rgba(10, 15, 29, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-logo .emoji {
    font-size: 1.8rem;
}
.header-logo h2 {
    font-size: 1.1rem;
}
.header-logo p {
    font-size: 0.75rem;
    color: var(--accent-teal);
}
.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
}
.app-content {
    padding: 20px;
}

/* --- Bottom Nav bar --- */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}
.nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    flex: 1;
}
.nav-item .nav-icon {
    font-size: 1.3rem;
    transition: transform 0.2s;
}
.nav-item .nav-label {
    font-size: 0.7rem;
    font-weight: 600;
}
.nav-item.active {
    color: var(--accent-teal);
}
.nav-item.active .nav-icon {
    transform: scale(1.15) translateY(-2px);
}

/* --- Tabs Handling --- */
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

/* --- Dashboard Specifics --- */
.card-hero {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(251, 113, 133, 0.05) 100%);
    border: 1px solid rgba(6, 182, 212, 0.15);
}
.quick-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.stat-item {
    text-align: center;
}
.stat-item .number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-teal);
    display: block;
}
.stat-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Progress Bar --- */
.progress-container {
    margin-top: 12px;
}
.progress-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-teal), var(--success-green));
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* --- Tasks & Lists --- */
.task-list {
    list-style: none;
}
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.task-item:last-child {
    border: none;
}
.task-status {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.task-status.todo {
    background: rgba(251, 146, 60, 0.15);
    color: var(--warning-orange);
}
.task-status.done {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success-green);
}
.task-info h5 {
    font-size: 0.9rem;
}
.task-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Seating (Cars) layout --- */
.seating-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.car-card {
    border-left: 4px solid var(--accent-teal);
}
.car-card.unreimbursed {
    border-left-color: var(--accent-coral);
}
.car-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}
.car-header h4 {
    font-size: 1.05rem;
}
.car-header .capacity {
    font-size: 0.8rem;
    padding: 3px 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 20px;
}
.passenger-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.passenger-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}
.passenger-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Rooms Layout --- */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.room-card {
    text-align: center;
    padding: 16px 12px;
}
.room-card .icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 6px;
}
.room-card h5 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.room-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Budget Page specifics --- */
.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}
.toggle-buttons {
    display: flex;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 3px;
}
.btn-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}
.btn-toggle.active {
    background: var(--accent-teal);
    color: white;
}
.budget-summary-block {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
}
.budget-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--accent-teal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.budget-circle .amount {
    font-size: 1.05rem;
    font-weight: 700;
}
.budget-circle .label {
    font-size: 0.6rem;
    color: var(--text-secondary);
}
.budget-legend {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}
.dot.lodging { background: var(--accent-teal); }
.dot.transport { background: var(--accent-coral); }
.dot.dining { background: var(--warning-orange); }
.dot.reserve { background: var(--success-green); }

.activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.activity-price {
    font-weight: 700;
    color: var(--accent-teal);
}

/* --- Chat feed --- */
.chat-container {
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}
.chat-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 12px;
    max-width: 85%;
}
.chat-bubble .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--accent-teal);
    margin-bottom: 4px;
}
.chat-bubble .msg-topic {
    font-weight: 600;
    color: var(--warning-orange);
}
.chat-bubble .text {
    font-size: 0.85rem;
    word-break: break-word;
}
