:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.08);
    --bg-glass: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.15);
    --text-primary: #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted: #55556a;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99,102,241,0.3);
    --cyan: #06b6d4;
    --emerald: #10b981;
    --amber: #f59e0b;
    --rose: #f43f5e;
    --gradient-main: linear-gradient(135deg, #6366f1, #06b6d4);
    --gradient-warm: linear-gradient(135deg, #f59e0b, #f43f5e);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.app { display:flex; flex-direction:column; height:100vh; }

/* Header */
.header {
    display:flex; align-items:center; justify-content:space-between;
    padding: 0 24px; height: 64px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    z-index: 100;
}
.header-left { display:flex; align-items:center; }
.logo { display:flex; align-items:center; gap:10px; }
.logo-icon { font-size:28px; }
.logo-text { font-size:20px; font-weight:700; background:var(--gradient-main); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.logo-badge {
    font-size:10px; font-weight:700; padding:2px 6px;
    background:var(--gradient-main); color:#fff;
    border-radius:4px; letter-spacing:1px;
}
.header-tagline { font-size:13px; color:var(--text-muted); font-weight:400; }
.source-badge {
    display:inline-block; font-size:11px; font-weight:600; padding:4px 10px;
    background:rgba(244,63,94,0.15); color:var(--rose); border:1px solid rgba(244,63,94,0.3);
    border-radius:20px; margin-bottom:8px;
}
.header-select-group { display:flex; gap:6px; align-items:center; }
.header-select {
    padding:6px 10px; background:var(--bg-card); border:1px solid var(--border);
    border-radius:var(--radius-xs); color:var(--text-primary); font-size:12px;
    font-family:inherit; cursor:pointer; outline:none; transition:var(--transition);
    -webkit-appearance:none; appearance:none;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b8b9e'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 8px center; padding-right:22px;
}
.header-select:hover { border-color:var(--border-hover); }
.header-select:focus { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-glow); }
.header-select option { background:var(--bg-secondary); color:var(--text-primary); }
.nav-tabs { display:flex; gap:4px; background:var(--bg-card); border-radius:var(--radius-sm); padding:4px; }
.nav-tab {
    display:flex; align-items:center; gap:6px; padding:8px 16px;
    border:none; background:transparent; color:var(--text-secondary);
    border-radius:var(--radius-xs); cursor:pointer; font-size:13px;
    font-family:inherit; font-weight:500; transition:var(--transition);
}
.nav-tab:hover { color:var(--text-primary); background:var(--bg-card-hover); }
.nav-tab.active { color:var(--text-primary); background:var(--accent); }
.tab-icon { font-size:16px; }
.theme-toggle {
    width:40px; height:40px; border:1px solid var(--border);
    background:transparent; border-radius:var(--radius-xs);
    cursor:pointer; font-size:18px; transition:var(--transition);
}
.theme-toggle:hover { background:var(--bg-card-hover); border-color:var(--border-hover); }

/* Main */
.main { flex:1; overflow:hidden; }
.view { display:none; height:100%; }
.view.active { display:flex; }

/* Chat */
.chat-container { display:flex; flex-direction:column; width:100%; max-width:900px; margin:0 auto; height:100%; }
.messages { flex:1; overflow-y:auto; padding:24px 16px; scroll-behavior:smooth; }
.messages::-webkit-scrollbar { width:4px; }
.messages::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

.message { display:flex; gap:12px; margin-bottom:20px; max-width:100%; }
.message.user { flex-direction:row-reverse; }
.message-avatar {
    width:36px; height:36px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:18px; flex-shrink:0;
    background:var(--bg-glass); border:1px solid var(--border);
}
.message.user .message-avatar { background:var(--accent); border:none; }
.message-content { max-width:80%; min-width:0; }
.message-bubble {
    padding:16px 20px; border-radius:var(--radius);
    background:var(--bg-glass); border:1px solid var(--border);
    line-height:1.6; font-size:14px;
    backdrop-filter:blur(10px);
}
.message.user .message-bubble {
    background:var(--accent); border:none;
    color:#fff; border-bottom-right-radius:4px;
}
.message.assistant .message-bubble { border-bottom-left-radius:4px; }
.message-bubble h2 { font-size:18px; margin-bottom:8px; }
.message-bubble p { margin-bottom:8px; color:var(--text-secondary); }
.message.user .message-bubble p { color:rgba(255,255,255,0.85); }
.message-bubble strong { color:var(--text-primary); }

/* Welcome */
.welcome-title { background:var(--gradient-main); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-size:22px; }
.feature-cards { display:flex; gap:10px; margin:16px 0; }
.feature-card {
    flex:1; display:flex; flex-direction:column; align-items:center; gap:8px;
    padding:16px 12px; background:var(--bg-card); border:1px solid var(--border);
    border-radius:var(--radius-sm); cursor:pointer; transition:var(--transition);
}
.feature-card:hover { background:var(--bg-card-hover); border-color:var(--accent); transform:translateY(-2px); }
.feature-icon { font-size:28px; }
.feature-text { font-size:13px; font-weight:600; }
.quick-suggestions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.suggestion {
    padding:8px 14px; background:var(--bg-card); border:1px solid var(--border);
    border-radius:20px; color:var(--text-secondary); font-size:12px;
    cursor:pointer; font-family:inherit; transition:var(--transition);
}
.suggestion:hover { border-color:var(--accent); color:var(--accent-light); background:var(--accent-glow); }

/* Chat Input */
.chat-input-container { padding:16px; border-top:1px solid var(--border); }
.chat-input-wrapper {
    display:flex; align-items:flex-end; gap:8px;
    background:var(--bg-glass); border:1px solid var(--border);
    border-radius:var(--radius); padding:8px 8px 8px 16px;
    transition:var(--transition);
}
.chat-input-wrapper:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); }
.chat-input {
    flex:1; border:none; background:transparent; color:var(--text-primary);
    font-size:15px; font-family:inherit; resize:none;
    outline:none; max-height:120px; line-height:1.5; padding:4px 0;
}
.chat-input::placeholder { color:var(--text-muted); }
.send-btn {
    width:40px; height:40px; border:none; background:var(--gradient-main);
    border-radius:var(--radius-xs); cursor:pointer; color:#fff;
    display:flex; align-items:center; justify-content:center;
    transition:var(--transition); flex-shrink:0;
}
.send-btn:hover { transform:scale(1.05); box-shadow:0 0 20px var(--accent-glow); }
.send-btn:disabled { opacity:0.4; cursor:not-allowed; transform:none; }
.input-hint { text-align:center; font-size:11px; color:var(--text-muted); margin-top:8px; }

/* Flight Cards */
.results-grid { display:flex; flex-direction:column; gap:12px; margin-top:12px; }
.flight-card {
    background:var(--bg-card); border:1px solid var(--border);
    border-radius:var(--radius); padding:20px; transition:var(--transition);
}
.flight-card:hover { border-color:var(--border-hover); background:var(--bg-card-hover); transform:translateY(-1px); box-shadow:var(--shadow); }
.flight-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.airline-info { display:flex; align-items:center; gap:10px; }
.airline-logo { font-size:24px; }
.airline-name { font-weight:600; font-size:14px; display:block; }
.flight-number { font-size:12px; color:var(--text-muted); }
.flight-price { text-align:right; }
.price-amount { font-size:24px; font-weight:800; background:var(--gradient-main); -webkit-background-clip:text; -webkit-text-fill-color:transparent; display:block; }
.price-label { font-size:11px; color:var(--text-muted); }
.flight-route { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.route-point { text-align:center; }
.route-time { font-size:20px; font-weight:700; display:block; }
.route-code { font-size:13px; color:var(--text-secondary); font-weight:500; }
.route-line { flex:1; text-align:center; }
.route-duration { font-size:12px; color:var(--text-secondary); display:block; margin-bottom:4px; }
.route-dots { display:flex; align-items:center; justify-content:center; gap:0; }
.dot { width:8px; height:8px; border-radius:50%; border:2px solid var(--accent); background:transparent; }
.line { flex:1; height:2px; background:linear-gradient(90deg,var(--accent),var(--cyan)); max-width:80px; }
.plane-icon { font-size:16px; color:var(--accent); margin:0 4px; }
.route-stops { font-size:11px; color:var(--emerald); display:block; margin-top:4px; }
.flight-card-footer { display:flex; justify-content:space-between; align-items:center; }
.flight-tags { display:flex; gap:6px; flex-wrap:wrap; }
.tag {
    font-size:11px; padding:4px 8px; border-radius:4px;
    background:var(--bg-card); border:1px solid var(--border); color:var(--text-secondary);
}
.tag-seats { color:var(--amber); border-color:rgba(245,158,11,0.3); }
.book-btn {
    padding:10px 24px; border:none; background:var(--gradient-main);
    color:#fff; font-weight:600; font-size:13px; border-radius:var(--radius-xs);
    cursor:pointer; font-family:inherit; transition:var(--transition);
}
.book-btn:hover { transform:translateY(-1px); box-shadow:0 4px 16px var(--accent-glow); }

/* Hotel Cards */
.hotel-card {
    display:flex; gap:16px; background:var(--bg-card); border:1px solid var(--border);
    border-radius:var(--radius); overflow:hidden; transition:var(--transition);
}
.hotel-card:hover { border-color:var(--border-hover); background:var(--bg-card-hover); transform:translateY(-1px); box-shadow:var(--shadow); }
.hotel-image {
    width:180px; min-height:200px; background:linear-gradient(135deg,var(--bg-secondary),var(--bg-card));
    display:flex; align-items:center; justify-content:center; flex-shrink:0; position:relative;
}
.hotel-image-placeholder { font-size:48px; opacity:0.3; }
.hotel-stars { position:absolute; bottom:8px; left:8px; font-size:12px; }
.hotel-info { flex:1; padding:16px 16px 16px 0; display:flex; flex-direction:column; }
.hotel-name { font-size:16px; font-weight:700; margin-bottom:4px; }
.hotel-district { font-size:12px; color:var(--text-muted); margin-bottom:8px; }
.hotel-rating { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.rating-score {
    background:var(--accent); color:#fff; padding:2px 8px;
    border-radius:4px; font-weight:700; font-size:13px;
}
.rating-text { font-size:12px; color:var(--text-secondary); }
.rating-reviews { font-size:11px; color:var(--text-muted); }
.hotel-amenities { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.amenity-tag {
    font-size:11px; padding:3px 8px; border-radius:4px;
    background:rgba(6,182,212,0.1); color:var(--cyan); border:1px solid rgba(6,182,212,0.2);
}
.hotel-pricing { display:flex; justify-content:space-between; align-items:flex-end; margin-top:auto; }
.hotel-price { font-size:22px; font-weight:800; background:var(--gradient-main); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.hotel-price-label { font-size:12px; color:var(--text-muted); }
.hotel-total { font-size:12px; color:var(--text-secondary); display:block; }
.hotel-meta { display:flex; flex-direction:column; gap:2px; align-items:flex-end; }
.hotel-cancellation { font-size:11px; color:var(--emerald); }
.hotel-breakfast { font-size:11px; color:var(--amber); }
.hotel-book-btn { margin-top:12px; width:100%; }

/* Typing indicator */
.typing-indicator { display:flex; gap:4px; padding:8px 0; }
.typing-dot {
    width:8px; height:8px; border-radius:50%; background:var(--text-muted);
    animation: typingBounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay:0.2s; }
.typing-dot:nth-child(3) { animation-delay:0.4s; }

/* Animations */
@keyframes typingBounce {
    0%,60%,100% { transform:translateY(0); opacity:0.4; }
    30% { transform:translateY(-8px); opacity:1; }
}
.animate-in {
    animation: slideIn 0.4s cubic-bezier(0.16,1,0.3,1);
}
@keyframes slideIn {
    from { opacity:0; transform:translateY(12px); }
    to { opacity:1; transform:translateY(0); }
}

/* Booking Modal */
.booking-modal {
    position:fixed; inset:0; z-index:9999;
    display:none; align-items:center; justify-content:center;
}
.booking-modal.active { display:flex; }
.booking-modal-overlay {
    position:absolute; inset:0; background:rgba(0,0,0,0.85);
    backdrop-filter:blur(8px);
    animation: fadeIn 0.3s ease;
}
.booking-modal-container {
    position:relative; width:95vw; height:90vh; max-width:1200px;
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:var(--radius); overflow:hidden;
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
    animation: modalSlideUp 0.4s cubic-bezier(0.16,1,0.3,1);
    display:flex; flex-direction:column;
}
.booking-modal-header {
    display:flex; justify-content:space-between; align-items:center;
    padding:12px 20px; background:var(--bg-primary);
    border-bottom:1px solid var(--border);
}
.booking-modal-title {
    display:flex; align-items:center; gap:8px;
    font-size:14px; font-weight:600; color:var(--text-primary);
}
.booking-modal-close {
    width:32px; height:32px; border:1px solid var(--border);
    background:transparent; color:var(--text-secondary);
    border-radius:6px; cursor:pointer; font-size:16px;
    display:flex; align-items:center; justify-content:center;
    transition:var(--transition);
}
.booking-modal-close:hover { background:var(--rose); color:#fff; border-color:var(--rose); }
.booking-modal-body { flex:1; position:relative; background:#fff; }
.booking-modal-body iframe {
    width:100%; height:100%; border:none;
}
.booking-loader {
    position:absolute; inset:0; display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:12px;
    background:var(--bg-secondary); color:var(--text-secondary);
    font-size:14px;
}
.booking-loader.hidden { display:none; }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes modalSlideUp {
    from { opacity:0; transform:translateY(40px) scale(0.95); }
    to { opacity:1; transform:translateY(0) scale(1); }
}

/* Responsive */
@media (max-width:768px) {
    .header { padding:0 12px; }
    .tab-label { display:none; }
    .nav-tab { padding:8px 12px; }
    .message-content { max-width:90%; }
    .feature-cards { flex-direction:column; }
    .hotel-card { flex-direction:column; }
    .hotel-image { width:100%; min-height:120px; }
    .hotel-info { padding:16px; }
    .booking-modal-container { width:100vw; height:100vh; border-radius:0; }
}
