/* Reset and base styles */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 14px; /* Smaller base font size */
    -webkit-text-size-adjust: 100%;
}

.chat-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: #000;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height */
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Main container - mobile first */
.chat-container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #f5f5f7;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .chat-body {
        background: #e5e5e7;
        position: static;
    }

    .chat-container {
        max-width: 428px; /* iPhone 14 Pro Max width */
        margin: 0 auto;
        height: 100vh;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
        border-radius: 0;
    }
}

@media (min-width: 1024px) {
    .chat-container {
        height: 90vh;
        margin: 5vh auto;
        border-radius: 20px;
        overflow: hidden;
    }
}

/* Header - mobile first */
.chat-header {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    color: white;
    padding: 0;
    padding-top: env(safe-area-inset-top);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
    z-index: 10;
    min-height: 44px;
}

.chat-header > * {
    padding: 8px 12px;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><polygon points="0,100 100,0 100,100" fill="rgba(255,255,255,0.03)"/></svg>');
    background-size: cover;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
    /* Prevent left block from expanding and pushing right controls off-screen */
    flex: 0 1 auto;
}

.header-right {
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2px; /* tighter to make room for connection status */
    padding-right: 6px; /* nudge group slightly left; ensure chip is visible */
}

/* Export Button */
.export-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.export-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.export-btn:hover {
    color: rgba(255, 255, 255, 1);
}

.export-btn:hover::before {
    opacity: 1;
    transform: scale(1);
}

.export-btn:active {
    transform: scale(0.95);
}

.export-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
    transition: all 0.2s ease;
}

.export-btn:hover svg {
    transform: translateY(1px);
}

/* Mobile adjustments for export button */
@media (max-width: 768px) {
    .export-btn {
        width: 32px;
        height: 32px;
    }
    
    .export-btn svg {
        width: 18px;
        height: 18px;
    }
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.connection-status.connected {
    background: rgba(76, 175, 80, 0.2);
}

.connection-status.disconnected {
    background: rgba(244, 67, 54, 0.2);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    transition: all 0.3s ease;
}

.connection-status.connected .status-dot {
    background: #4CAF50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
}

.connection-status.disconnected .status-dot {
    background: #F44336;
    box-shadow: 0 0 4px rgba(244, 67, 54, 0.5);
}

.etihad-logo {
    height: 18px;
    width: auto;
    filter: brightness(0) invert(1);
}

.divider {
    height: 16px;
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.chat-title {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

/* Desktop header adjustments */
@media (min-width: 768px) {
    .chat-header {
        min-height: 48px;
    }
    
    .chat-header > * {
        padding: 10px 16px;
    }

    .etihad-logo {
        height: 24px;
    }

    .chat-title {
        font-size: 13px;
        letter-spacing: 1px;
    }

    .connection-status {
        font-size: 11px;
        padding: 3px 10px;
    }
}

/* Token counter - mobile first */
.token-counter {
    background: rgba(44, 62, 80, 0.04);
    padding: 6px 12px;
    border-bottom: 1px solid rgba(44, 62, 80, 0.08);
    font-size: 10px;
    color: #2C3E50;
    flex-shrink: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

.token-counter-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-toggle,
.widget-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    color: rgba(44, 62, 80, 0.75);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.25);
    transition: 0.2s ease;
    border-radius: 16px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    border-radius: 50%;
    transition: 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: #0b4da6;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(14px);
}

.toggle-label {
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.3px;
}

/* Developer shield indicator */
.dev-shield {
    position: absolute;
    left: 58%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background: rgba(44, 62, 80, 0.08);
    border-radius: 8px;
    cursor: default;
    transition: all 0.2s ease;
}

.dev-shield:hover {
    background: rgba(44, 62, 80, 0.12);
}

.dev-shield-version {
    font-size: 9px;
    color: #2C3E50;
    opacity: 0.6;
    font-weight: 600;
    letter-spacing: 0.25px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 36px;
    height: 20px;
    appearance: none;
    background: #e9e9eb;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    outline: none;
}

.toggle-label input[type="checkbox"]:checked {
    background: #2C3E50;
}

.toggle-label input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.toggle-label input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

@media (min-width: 768px) {
    .token-counter {
        padding: 8px 16px;
        font-size: 11px;
    }
}

/* Chat area - mobile first */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Disclaimer message */
.disclaimer-message {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 auto 16px;
    max-width: 500px;
    text-align: center;
    font-size: 11px;
    color: #6c757d;
    line-height: 1.4;
    opacity: 0.9;
    flex-shrink: 0;
}

.disclaimer-message .alpha-badge {
    display: inline-block;
    background: #ffc107;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 9px;
    margin-left: 4px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.disclaimer-message .date-text {
    display: inline-block;
    font-size: 10px;
    color: #495057;
    margin-left: 8px;
    opacity: 0.8;
    font-style: italic;
}

@media (min-width: 768px) {
    .chat-area {
        padding: 16px 20px;
    }
}

/* Message styling - mobile first */
.message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    max-width: 100%;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.message-wrapper.user {
    align-items: flex-end;
}

.message-wrapper.assistant {
    align-items: flex-start;
}

.progress-message {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 122, 255, 0.08);
    color: #0b4da6;
    padding: 8px 12px;
    margin: 6px 16px 6px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    border: 1px solid rgba(0, 122, 255, 0.12);
}

.progress-spinner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(11, 77, 166, 0.2);
    border-top-color: #0b4da6;
    animation: chat-progress-spin 0.9s linear infinite;
}

.progress-message.progress-complete .progress-spinner {
    animation: none;
    border-color: rgba(11, 77, 166, 0.25);
    border-top-color: rgba(11, 77, 166, 0.25);
}

.progress-spinner.complete {
    animation: none;
    border-color: rgba(29, 130, 74, 0.35);
    border-top-color: rgba(29, 130, 74, 0.35);
    background: rgba(29, 130, 74, 0.45);
}

.progress-message.progress-complete {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.25);
    color: #1d824a;
}

.progress-text {
    flex: 1;
}

.progress-duration {
    margin-left: 6px;
    font-size: 0.78rem;
    color: rgba(11, 77, 166, 0.7);
    font-variant-numeric: tabular-nums;
}

@keyframes chat-progress-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.message-content {
    max-width: 85%;
    min-width: 60px;
}

/* Thinking time indicator - mobile first */
.thinking-time-indicator {
    font-size: 10px;
    color: #8E8E93;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.thinking-time-icon {
    font-size: 11px;
}

.message-wrapper.user .thinking-time-indicator {
    margin-right: 12px;
}

.message-wrapper.assistant .thinking-time-indicator {
    margin-left: 12px;
}

@media (min-width: 768px) {
    .message-wrapper {
        margin-bottom: 16px;
    }
    
    .thinking-time-indicator {
        font-size: 11px;
    }
    
    .thinking-time-icon {
        font-size: 12px;
    }
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left;
    letter-spacing: -0.01em;
    position: relative;
}

.message-bubble.user {
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    color: white;
    border: none;
}

.message-bubble.assistant {
    background: #E9E9EB;
    color: #1C1C1E;
    border: none;
}

@media (min-width: 768px) {
    .message-bubble {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Structured widgets */
.message-bubble .etihad-widget + .etihad-widget {
    margin-top: 10px;
}

.etihad-widget {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px;
    margin-top: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    font-size: 12px;
    color: #0f172a;
}

.etihad-widget[data-widget-type="farebrand-options"] {
    padding: 10px;
}

.etihad-widget[data-widget-type="farebrand-options"] .etihad-widget-header {
    margin-bottom: 6px;
}

.etihad-widget-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.etihad-widget-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    color: #0b4da6;
}

.etihad-widget-meta {
    font-size: 0.7rem;
    color: rgba(28, 28, 30, 0.55);
    font-weight: 600;
}

.etihad-flight-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .etihad-flight-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.flight-card {
    background: linear-gradient(135deg, rgba(11, 77, 166, 0.06), rgba(11, 77, 166, 0.02));
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flight-card-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(11, 39, 63, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.flight-route {
    display: inline-flex;
    gap: 6px;
    align-items: baseline;
    font-size: 0.78rem;
    color: #0b273f;
    text-transform: none;
}

.flight-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.flight-card-footer .flight-tags {
    flex: 1 1 60%;
    min-width: 140px;
}

.flight-total {
    margin-left: auto;
    text-align: right;
}

.total-label {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    color: rgba(28, 28, 30, 0.55);
}

.total-price {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #c99700;
}

.flight-leg {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flight-leg-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 0.72rem;
    color: rgba(28, 28, 30, 0.7);
}

.leg-heading {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.leg-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #0b4da6;
}

.leg-divider {
    font-size: 0.7rem;
    color: rgba(11, 77, 166, 0.5);
}

.leg-flight-number {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(28, 28, 30, 0.75);
}

.leg-duration {
    font-size: 0.7rem;
    color: rgba(28, 28, 30, 0.55);
}

.flight-leg-body {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.flight-port {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.72rem;
    color: rgba(28, 28, 30, 0.75);
}

.port-label {
    font-size: 0.6rem;
    letter-spacing: 0.45px;
    text-transform: uppercase;
    color: rgba(28, 28, 30, 0.45);
}

.port-code {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0b273f;
}

.port-city {
    font-size: 0.68rem;
    color: rgba(28, 28, 30, 0.55);
}

.port-time {
    font-size: 0.72rem;
    color: rgba(28, 28, 30, 0.7);
}

.leg-arrow {
    font-size: 0.9rem;
    color: rgba(11, 77, 166, 0.6);
    align-self: center;
}

.flight-leg-connections {
    font-size: 0.68rem;
    color: rgba(28, 28, 30, 0.6);
}

.flight-divider {
    height: 1px;
    background: rgba(11, 77, 166, 0.12);
    margin: 2px 0;
}

.flight-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.flight-tag {
    font-size: 0.64rem;
    font-weight: 600;
    background: rgba(11, 77, 166, 0.12);
    color: #0b4da6;
    padding: 2px 6px;
    border-radius: 10px;
}

.farebrand-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.farebrand-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(11, 77, 166, 0.12);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.farebrand-card.is-recommended {
    border-color: rgba(11, 77, 166, 0.35);
    box-shadow: 0 2px 6px rgba(11, 77, 166, 0.12);
}

.farebrand-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.farebrand-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #0b273f;
}

.farebrand-badge {
    font-size: 0.65rem;
    background: #0b4da6;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.farebrand-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0b4da6;
}

.farebrand-breakdown {
    margin-top: 2px;
    display: grid;
    gap: 2px;
}

.farebrand-breakdown-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.68rem;
    color: rgba(28, 28, 30, 0.55);
}

.farebrand-breakdown-label {
    font-weight: 600;
}

.farebrand-breakdown-value {
    text-align: right;
}

.farebrand-miles {
    font-size: 0.7rem;
    color: rgba(28, 28, 30, 0.55);
}

.farebrand-benefits,
.booking-flight-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.68rem;
    color: rgba(28, 28, 30, 0.68);
}

.farebrand-benefits li,
.booking-flight-benefits li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.farebrand-benefits li::before,
.booking-flight-benefits li::before {
    content: '•';
    color: #0b4da6;
    font-size: 0.8rem;
}

.farebrand-benefits-more,
.booking-flight-benefits-more {
    color: rgba(28, 28, 30, 0.45);
    font-style: italic;
}

.farebrand-benefits-more::before,
.booking-flight-benefits-more::before {
    content: none;
}

.booking-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.75rem;
}

.booking-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.booking-meta-item {
    background: rgba(11, 77, 166, 0.08);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
}

.meta-label {
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    color: rgba(28, 28, 30, 0.55);
}

.meta-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0b273f;
}

.booking-flights {
    display: grid;
    gap: 8px;
}

.booking-flight {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(11, 77, 166, 0.12);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.booking-flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #0b273f;
    font-size: 0.78rem;
}

.booking-flight-route {
    font-size: 0.75rem;
    color: rgba(28, 28, 30, 0.7);
}

.booking-flight-fare {
    font-size: 0.68rem;
    background: rgba(11, 77, 166, 0.12);
    color: #0b4da6;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.booking-flight-price {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0b4da6;
}

.booking-passenger {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    background: rgba(11, 77, 166, 0.05);
    border-radius: 10px;
    padding: 8px;
}

.passenger-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.passenger-item .meta-value {
    font-size: 0.74rem;
    color: #0b273f;
    word-break: break-word;
}

.passenger-item .meta-label {
    font-size: 0.62rem;
    color: rgba(28, 28, 30, 0.55);
}

/* ============================================
   NEW WIDGET STYLES
   ============================================ */

/* Recommended Flight Widget */
.etihad-widget-recommended {
    background: linear-gradient(135deg, rgba(11, 77, 166, 0.08), rgba(201, 151, 0, 0.06));
}

.recommended-badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #0b4da6, #0a3d8a);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.rec-text {
    font-size: 0.75rem;
    color: rgba(28, 28, 30, 0.7);
    margin-bottom: 8px;
    line-height: 1.4;
}

.rec-flight-card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rec-flight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.rec-flight-number {
    font-weight: 700;
    color: #0b273f;
}

.rec-aircraft {
    color: rgba(28, 28, 30, 0.55);
}

.rec-stop-type {
    margin-left: auto;
    font-size: 0.68rem;
    background: rgba(11, 77, 166, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    color: #0b4da6;
}

.rec-flight-route {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.rec-duration {
    font-size: 0.7rem;
    color: rgba(28, 28, 30, 0.55);
    text-align: center;
}

.rec-fare {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(11, 77, 166, 0.1);
}

.rec-fare-name {
    font-weight: 600;
    color: #0b273f;
}

.rec-fare-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #c99700;
}

.rec-business-upgrade {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-top: 8px;
    background: linear-gradient(135deg, #f8f4e8 0%, #fff9e6 100%);
    border: 1px solid #d4a853;
    border-radius: 6px;
    font-size: 0.85rem;
}

.rec-business-upgrade .business-label {
    color: #8b6914;
    font-weight: 500;
}

.rec-business-upgrade .business-price {
    color: #6b5311;
    font-weight: 700;
}

.rec-includes,
.rec-reasons {
    font-size: 0.72rem;
}

.rec-includes-title,
.rec-reasons-title {
    font-weight: 600;
    color: rgba(28, 28, 30, 0.7);
    margin-bottom: 4px;
}

.rec-reasons-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rec-reasons-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(28, 28, 30, 0.68);
}

.rec-reasons-list li::before {
    content: '★';
    color: #c99700;
    font-size: 0.7rem;
}

/* Flight Search Results Widget */
.etihad-widget-search-results {
    padding: 10px;
}

.search-cabin-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.cabin-tab {
    font-size: 0.68rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(11, 77, 166, 0.08);
    color: rgba(28, 28, 30, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cabin-tab.active,
.cabin-tab:hover {
    background: #0b4da6;
    color: #ffffff;
}

.search-flights-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-flight-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(11, 77, 166, 0.1);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-flight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    flex-wrap: wrap;
}

.search-flight-numbers {
    font-weight: 700;
    color: #0b273f;
}

.search-aircraft {
    color: rgba(28, 28, 30, 0.55);
}

.search-stops {
    font-size: 0.65rem;
    background: rgba(11, 77, 166, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    color: #0b4da6;
}

.search-flight-times {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(11, 77, 166, 0.04);
    border-radius: 10px;
}

.search-departure,
.search-arrival {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-time {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0b273f;
}

.search-port {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0b4da6;
}

.search-date {
    font-size: 0.65rem;
    color: rgba(28, 28, 30, 0.55);
}

.search-duration {
    font-size: 0.7rem;
    color: rgba(28, 28, 30, 0.5);
    text-align: center;
}

.search-seats {
    font-size: 0.65rem;
    color: #d97706;
    font-weight: 600;
}

.search-farebrands {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
}

.search-farebrand {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(11, 77, 166, 0.15);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-farebrand:hover {
    border-color: rgba(11, 77, 166, 0.4);
    box-shadow: 0 2px 6px rgba(11, 77, 166, 0.1);
}

.search-farebrand.is-recommended {
    border-color: #0b4da6;
    background: rgba(11, 77, 166, 0.05);
}

.search-fb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.search-fb-name {
    font-weight: 600;
    font-size: 0.72rem;
    color: #0b273f;
}

.search-fb-price {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0b4da6;
}

.search-fb-diff {
    font-size: 0.65rem;
    color: rgba(28, 28, 30, 0.55);
}

.search-fb-includes {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.62rem;
    color: rgba(28, 28, 30, 0.6);
}

.search-fb-includes li {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-fb-includes li::before {
    content: '✓';
    color: #16a34a;
    font-size: 0.6rem;
}

/* Passenger Contact Details Widget */
.etihad-widget-pax-form {
    background: linear-gradient(135deg, rgba(11, 77, 166, 0.06), rgba(11, 77, 166, 0.02));
}

.pax-form-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pax-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pax-field {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pax-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    color: rgba(28, 28, 30, 0.55);
}

.pax-value {
    font-size: 0.75rem;
    color: #0b273f;
}

.pax-value.pax-required {
    color: #d97706;
    font-style: italic;
}

.pax-form-hint {
    font-size: 0.7rem;
    color: rgba(28, 28, 30, 0.6);
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 3px solid #0b4da6;
}

.pax-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.8rem;
    border: 1px solid rgba(11, 77, 166, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #0b273f;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pax-input:focus {
    outline: none;
    border-color: #0b4da6;
    box-shadow: 0 0 0 2px rgba(11, 77, 166, 0.1);
}

.pax-input:disabled {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(11, 39, 63, 0.6);
    cursor: not-allowed;
}

.pax-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230b4da6' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

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

.pax-submit-btn {
    padding: 10px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #0b4da6 0%, #083a7d 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pax-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 77, 166, 0.3);
}

.pax-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pax-submit-btn.submitted {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Pre-confirmation Widget */
.etihad-widget-preconfirm {
    background: linear-gradient(135deg, rgba(11, 77, 166, 0.06), rgba(201, 151, 0, 0.04));
}

.preconfirm-route {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0b273f;
    margin-bottom: 8px;
}

.preconfirm-legs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preconfirm-leg {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 10px;
}

.preconfirm-leg-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #0b4da6;
    margin-bottom: 6px;
}

.preconfirm-cabin {
    font-size: 0.65rem;
    background: rgba(11, 77, 166, 0.12);
    color: #0b4da6;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
}

.preconfirm-leg-times {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.preconfirm-departure,
.preconfirm-arrival {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preconfirm-time {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0b273f;
}

.preconfirm-info {
    font-size: 0.68rem;
    color: rgba(28, 28, 30, 0.6);
}

.preconfirm-duration {
    font-size: 0.68rem;
    color: rgba(28, 28, 30, 0.5);
}

.preconfirm-guest {
    background: rgba(11, 77, 166, 0.06);
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
}

.preconfirm-guest-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(28, 28, 30, 0.6);
    margin-bottom: 4px;
}

.preconfirm-guest-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0b273f;
}

.preconfirm-guest-type {
    font-size: 0.68rem;
    color: rgba(28, 28, 30, 0.6);
}

.preconfirm-guest-contact {
    font-size: 0.7rem;
    color: rgba(28, 28, 30, 0.7);
}

.preconfirm-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(201, 151, 0, 0.1);
    border-radius: 10px;
    margin-top: 8px;
}

.preconfirm-total-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(28, 28, 30, 0.7);
}

.preconfirm-total-price {
    font-size: 1rem;
    font-weight: 700;
    color: #c99700;
}

.preconfirm-action {
    font-size: 0.72rem;
    color: rgba(28, 28, 30, 0.6);
    text-align: center;
    margin-top: 8px;
    padding: 8px;
    background: rgba(11, 77, 166, 0.06);
    border-radius: 8px;
}

/* Payment Link Widget */
.etihad-widget-payment {
    background: linear-gradient(135deg, rgba(201, 151, 0, 0.1), rgba(201, 151, 0, 0.05));
    text-align: center;
}

.payment-message {
    font-size: 0.78rem;
    color: rgba(28, 28, 30, 0.75);
    margin-bottom: 12px;
    line-height: 1.4;
}

.payment-button {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #c99700, #a67c00);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(201, 151, 0, 0.3);
}

.payment-button:hover {
    background: linear-gradient(135deg, #a67c00, #8a6700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 151, 0, 0.4);
}

/* Booking Confirmation Widget */
.etihad-widget-confirmed {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(22, 163, 74, 0.05));
    text-align: center;
}

.confirmation-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.confirmation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #16a34a;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

.confirmation-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #16a34a;
}

.confirmation-subtitle {
    font-size: 0.75rem;
    color: rgba(28, 28, 30, 0.7);
    margin-bottom: 10px;
}

.confirmation-ref {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.confirmation-ref-label {
    font-size: 0.68rem;
    color: rgba(28, 28, 30, 0.6);
}

.confirmation-ref-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0b273f;
    letter-spacing: 1px;
}

.confirmation-email {
    font-size: 0.7rem;
    color: rgba(28, 28, 30, 0.6);
}

.message-timestamp {
    font-size: 10px;
    color: #8E8E93;
    margin-top: 4px;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.message-wrapper.user .message-timestamp {
    justify-content: flex-end;
}

.message-wrapper.assistant .message-timestamp {
    justify-content: flex-start;
}

/* Feedback buttons for assistant messages */
.message-feedback {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.message-wrapper:hover .message-feedback {
    opacity: 1;
}

.feedback-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8E8E93;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.feedback-btn:hover {
    color: #3C3C43;
    background: rgba(0, 0, 0, 0.05);
}

.feedback-btn:active {
    transform: scale(0.9);
}

.feedback-btn.active {
    color: white;
    background: #007AFF;
    box-shadow: 0 1px 3px rgba(0, 122, 255, 0.3);
}

.feedback-btn.active:hover {
    background: #0051D5;
    color: white;
}

.feedback-btn svg {
    width: 12px;
    height: 12px;
}

.feedback-btn.active svg {
    stroke-width: 2.5;
}

/* Always show feedback on mobile devices */
@media (hover: none) {
    .message-feedback {
        opacity: 0.8;
    }
}

/* Edit button for user messages */
.message-edit {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.message-wrapper:hover .message-edit {
    opacity: 1;
}

.edit-btn, .refresh-btn, .edit-user-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8E8E93;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.edit-btn:hover, .refresh-btn:hover, .edit-user-btn:hover {
    color: #3C3C43;
    background: rgba(0, 0, 0, 0.05);
}

.edit-btn:active, .refresh-btn:active, .edit-user-btn:active {
    transform: scale(0.9);
}

.edit-btn svg, .refresh-btn svg, .edit-user-btn svg {
    width: 12px;
    height: 12px;
}

/* Always show edit button on mobile devices */
@media (hover: none) {
    .message-edit {
        opacity: 0.8;
    }
}

/* Edit interface styles */
.edit-message-container {
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.edit-message-input {
    margin-bottom: 12px;
}

.edit-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.edit-textarea:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.edit-message-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.edit-save-btn,
.edit-cancel-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-save-btn {
    background: #007AFF;
    color: white;
}

.edit-save-btn:hover {
    background: #0051D5;
}

.edit-cancel-btn {
    background: #f1f3f4;
    color: #5f6368;
}

.edit-cancel-btn:hover {
    background: #e8eaed;
}

.edit-save-btn:active,
.edit-cancel-btn:active {
    transform: scale(0.95);
}

/* Edited indicator */
.edited-indicator {
    font-size: 12px;
    color: #8E8E93;
    font-style: italic;
    opacity: 0.8;
}

/* Context Panel - mobile first */
.context-panel {
    position: relative;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.context-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease;
}

.context-header:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.context-header:active {
    background-color: rgba(0, 0, 0, 0.04);
}

.context-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.context-icon {
    font-size: 16px;
}

#contextSummaryText {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: #666;
}

.context-panel.collapsed .expand-icon {
    transform: rotate(180deg);
}

.context-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 16px;
}

.context-panel:not(.collapsed) .context-details {
    max-height: 400px;
    opacity: 1;
    padding: 0 16px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.collapse-button {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: none;
    border-radius: 14px;
    padding: 4px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    z-index: 5;
    color: #007AFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
}

.collapse-button:hover {
    background: #f5f5f7;
    transform: translateX(-50%) scale(1.05);
}

.collapse-button:active {
    transform: translateX(-50%) scale(0.95);
}

.collapse-button svg {
    transition: transform 0.3s ease;
}

/* Removed old suggestion CSS - replaced with context panel */

/* Input area - mobile first */
.input-area {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(247, 247, 247, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .input-area {
        padding: 16px 20px;
        gap: 12px;
    }
}

.message-input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    -webkit-appearance: none;
    resize: none;
}

.message-input:focus {
    box-shadow: 0 2px 12px rgba(0, 122, 255, 0.2);
}

@media (min-width: 768px) {
    .message-input {
        padding: 12px 16px;
        font-size: 13px;
    }
}

.send-button {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
    -webkit-tap-highlight-color: transparent;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

.send-button:active {
    transform: scale(0.95);
}

.send-text {
    display: none;
}

.send-icon {
    font-size: 20px;
    font-weight: bold;
    margin-left: -2px;
}

@media (min-width: 768px) {
    .send-button {
        width: auto;
        height: auto;
        padding: 12px 24px;
        border-radius: 24px;
    }
    
    .send-text {
        display: inline;
    }
    
    .send-icon {
        display: none;
    }
}

/* Thinking blocks - mobile first */
.thinking-block {
    margin: 8px 0;
    border-left: 3px solid #007AFF;
    padding-left: 12px;
    position: relative;
}

.thinking-toggle {
    background: rgba(0, 122, 255, 0.08);
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: #007AFF;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.thinking-toggle:hover,
.thinking-toggle:active {
    background: rgba(0, 122, 255, 0.12);
}

.thinking-toggle svg {
    width: 10px;
    height: 10px;
    transition: transform 0.3s ease;
}

.thinking-content {
    font-style: italic;
    color: #8E8E93;
    margin-top: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    font-size: 13px;
}

.thinking-block.collapsed .thinking-content {
    max-height: 0;
    margin: 0;
    opacity: 0;
}

.thinking-block.collapsed .thinking-toggle svg {
    transform: rotate(-90deg);
}

/* Thinking placeholder styling - mobile first */
.thinking-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05) 0%, rgba(0, 122, 255, 0.1) 100%);
    border-radius: 16px;
    font-size: 12px;
    color: #007AFF;
    margin: 6px 4px 6px 0;
    position: relative;
    overflow: hidden;
    min-width: 100px;
}

/* Multiple thinking placeholders in the same bubble */
.thinking-placeholder + .thinking-placeholder {
    margin-left: 4px;
}

.thinking-placeholder-content {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.thinking-time {
    font-weight: 600;
    color: #0051D5;
    font-size: 11px;
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.thinking-airplane {
    font-size: 16px;
    position: absolute;
    left: -30px;
    animation: fly-across 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

@keyframes fly-across {
    0% {
        left: -30px;
        transform: translateY(0) rotate(-5deg);
    }
    25% {
        transform: translateY(-3px) rotate(0deg);
    }
    50% {
        transform: translateY(2px) rotate(5deg);
    }
    75% {
        transform: translateY(-2px) rotate(0deg);
    }
    100% {
        left: calc(100% + 30px);
        transform: translateY(0) rotate(-5deg);
    }
}

.thinking-clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0.3;
    overflow: hidden;
}

.cloud {
    position: absolute;
    font-size: 20px;
    opacity: 0.6;
    animation: drift 8s linear infinite;
}

.cloud:nth-child(1) {
    top: 20%;
    animation-delay: 0s;
    animation-duration: 10s;
}

.cloud:nth-child(2) {
    top: 60%;
    animation-delay: 3s;
    animation-duration: 12s;
}

.cloud:nth-child(3) {
    top: 40%;
    animation-delay: 6s;
    animation-duration: 9s;
}

@keyframes drift {
    from {
        left: -50px;
    }
    to {
        left: calc(100% + 50px);
    }
}

.thinking-placeholder-text {
    font-style: italic;
    font-weight: 500;
    color: #007AFF;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.thinking-active .thinking-airplane {
    animation-duration: 2s;
}

/* User message thinking adjustments */
.message-bubble.user .thinking-placeholder {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.25) 100%);
}

.message-bubble.user .thinking-placeholder-text {
    color: rgba(255, 255, 255, 0.9);
}

.message-bubble.user .thinking-time {
    color: rgba(255, 255, 255, 0.9);
}

.message-bubble.user .cloud {
    opacity: 0.3;
}

.message-bubble.user .thinking-content {
    color: rgba(255, 255, 255, 0.85);
}

.message-bubble.user .thinking-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
}

.message-bubble.user .thinking-toggle:hover,
.message-bubble.user .thinking-toggle:active {
    background: rgba(255, 255, 255, 0.3);
}

.message-bubble.user .thinking-block {
    border-left-color: rgba(255, 255, 255, 0.5);
}

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

.slide-in {
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Markdown styling */
.message-bubble h1, .message-bubble h2, .message-bubble h3,
.message-bubble h4, .message-bubble h5, .message-bubble h6 {
    margin: 10px 0 5px 0;
    font-weight: 600;
}

.message-bubble h1 { font-size: 1.4em; }
.message-bubble h2 { font-size: 1.3em; }
.message-bubble h3 { font-size: 1.2em; }
.message-bubble h4 { font-size: 1.1em; }

@media (max-width: 768px) {
    .message-bubble h1 { font-size: 1.3em; }
    .message-bubble h2 { font-size: 1.2em; }
    .message-bubble h3 { font-size: 1.15em; }
    .message-bubble h4 { font-size: 1.05em; }
}

.message-bubble p {
    margin: 6px 0;
}

.message-bubble p:first-child {
    margin-top: 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin: 4px 0;
}

.message-bubble blockquote {
    border-left: 3px solid #2C3E50;
    margin: 10px 0;
    padding: 5px 0 5px 15px;
    background: rgba(44, 62, 80, 0.05);
    border-radius: 0 5px 5px 0;
}

.message-bubble code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.message-bubble pre {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .message-bubble pre {
        padding: 8px;
        font-size: 13px;
    }
}

.message-bubble pre code {
    background: none;
    padding: 0;
}

.message-bubble table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
    font-size: 10px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

@media (max-width: 768px) {
    .message-bubble table {
        font-size: 9px;
        margin: 8px -4px;
    }
}

.message-bubble thead, .message-bubble tbody, .message-bubble tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.message-bubble th, .message-bubble td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
    display: table-cell;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 25%; /* Equal width columns */
}

@media (max-width: 768px) {
    .message-bubble th, .message-bubble td {
        padding: 4px 6px;
    }
}

.message-bubble th {
    background: #f5f5f5;
    font-weight: 600;
    white-space: nowrap;
}

/* Style for table first column */
.message-bubble td:first-child,
.message-bubble th:first-child {
    font-weight: 600;
    color: #007AFF;
    text-align: center;
    width: 25%; /* Equal width like other columns */
    white-space: nowrap;
}

/* Make table rows clickable */
.message-bubble tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.message-bubble tbody tr:hover {
    background-color: rgba(0, 122, 255, 0.1);
}

.message-bubble tbody tr:active {
    background-color: rgba(0, 122, 255, 0.2);
}

/* Add scrollbar styling for tables */
.message-bubble table::-webkit-scrollbar {
    height: 6px;
}

.message-bubble table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.message-bubble table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.message-bubble table::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Compact table styling for better mobile display */
@media (max-width: 768px) {
    .message-bubble table {
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .message-bubble th {
        font-size: 9px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
}

.message-bubble a {
    color: #2C3E50;
    text-decoration: none;
    font-weight: 500;
}

.message-bubble a:hover {
    text-decoration: underline;
}

.message-bubble strong {
    font-weight: 600;
}

.message-bubble em {
    font-style: italic;
}

.message-bubble hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 15px 0;
}

/* User message markdown adjustments */
.message-bubble.user code {
    background: rgba(255, 255, 255, 0.2);
}

.message-bubble.user blockquote {
    border-left-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.message-bubble.user a {
    color: #fff;
}

/* Remove duplicate - already defined above */

/* Assistant response timer */
.response-timer {
    color: #60a5fa;
    animation: pulse 1.5s ease-in-out infinite;
    font-size: 14px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    letter-spacing: 0.08em;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* iOS notch and home indicator adjustments - already handled inline above */

/* Copy notification */
.copy-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.copy-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.copy-notification::before {
    content: '✓';
    margin-right: 8px;
    font-size: 16px;
    color: #4CAF50;
}

/* Export notification */
.export-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 10000;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.export-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.export-notification:not(.error)::before {
    content: '✓';
    margin-right: 8px;
    font-size: 16px;
    color: #4CAF50;
}

.export-notification.error {
    background: rgba(244, 67, 54, 0.9);
}

.export-notification.error::before {
    content: '✕';
    margin-right: 8px;
    font-size: 16px;
}

/* Context details styling */
.context-details h3 {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px 0;
    padding: 0;
}

.context-details h3:first-child {
    margin-top: 8px;
}

.context-section {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.context-section:last-child {
    margin-bottom: 0;
}

.context-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

/* Memory-specific styles */
.context-item.high-importance {
    border-left: 3px solid #007AFF;
    padding-left: 12px;
    background: rgba(0, 122, 255, 0.05);
    margin-left: -12px;
}

.context-meta {
    font-size: 0.75em;
    color: #999;
    margin-left: 8px;
    font-style: italic;
}

.context-label {
    color: #666;
    font-weight: 400;
}

.context-value {
    color: #333;
    font-weight: 500;
    text-align: right;
}

.context-flight {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.context-flight:last-child {
    border-bottom: none;
}

.context-flight.selected {
    background: rgba(0, 122, 255, 0.05);
    border-left: 3px solid #007AFF;
    padding-left: 13px;
    margin-left: -16px;
    margin-right: -16px;
    padding-right: 16px;
}

.context-flight.confirmed {
    background: rgba(76, 175, 80, 0.05);
    border-left: 3px solid #4CAF50;
    padding-left: 13px;
    margin-left: -16px;
    margin-right: -16px;
    padding-right: 16px;
}

.flight-route {
    font-weight: 600;
    color: #007AFF;
}

.flight-details {
    font-size: 12px;
    color: #666;
    flex: 1;
}

.flight-price {
    font-weight: 600;
    color: #333;
}

/* Flight Details Card Styles */
.flight-details-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 14px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.1);
    width: 100%;
}

.flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.flight-number {
    font-size: 16px;
    font-weight: 700;
    color: #007AFF;
    letter-spacing: 0.5px;
}

.flight-route {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.flight-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.flight-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.info-label {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.info-value {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    text-align: right;
}

.info-value.price {
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
}

/* Make flight cards responsive */
@media (min-width: 360px) {
    .flight-info-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 16px;
    }
}

/* Desktop adjustments for context panel */
@media (min-width: 768px) {
    .context-header {
        padding: 14px 20px;
    }
    
    #contextSummaryText {
        font-size: 14px;
    }
    
    .context-panel:not(.collapsed) .context-details {
        padding: 0 20px 20px;
    }
}

/* Bug Report Button Styles */
.bug-report-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: rgba(244, 67, 54, 0.8);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    margin-right: 4px;
    margin-top: 2px;
}

.bug-report-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(255, 100, 100, 0.1);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.bug-report-btn:hover {
    color: rgba(244, 67, 54, 1);
}

.bug-report-btn:hover::before {
    opacity: 1;
    transform: scale(1);
}

.bug-report-btn:active {
    transform: scale(0.95);
}

.bug-report-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
    transition: all 0.2s ease;
}

.bug-report-btn:hover svg {
    transform: scale(1.1);
}

/* Mobile adjustments for bug report button */
@media (max-width: 768px) {
    .bug-report-btn {
        width: 32px;
        height: 32px;
    }
    
    .bug-report-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Bug Report Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    padding: 20px 24px 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 0 24px 20px 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

.modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
}

.btn-secondary,
.btn-primary {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid;
}

.btn-secondary {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-primary:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-width: none;
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
}

/* Rating Buttons Styles */
.rating-buttons {
    margin: 16px 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.rating-btn {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 1px solid #444;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    min-width: 60px;
}

.rating-btn:hover {
    background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
    border-color: #555;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rating-btn:active {
    transform: translateY(0);
}

.rating-thank-you {
    text-align: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
}

.rating-thank-you p {
    margin: 4px 0;
    font-weight: 500;
}

/* Multi-Category Rating Styles */
.multi-rating-section {
    margin: 16px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    border: 1px solid #444;
}

.rating-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid #333;
}

.category-label {
    font-weight: 600;
    color: #fff;
    min-width: 140px;
    font-size: 14px;
}

.category-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.category-rating-btn {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 1px solid #444;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 45px;
}

.category-rating-btn:hover {
    background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
    border-color: #555;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-rating-btn.selected {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.category-rating-btn.selected:hover {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #059669;
}

.category-rating-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .rating-buttons {
        gap: 6px;
    }
    
    .rating-btn {
        padding: 6px 12px;
        font-size: 14px;
        min-width: 50px;
    }
    
    .multi-rating-section {
        padding: 16px;
    }
    
    .rating-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .category-label {
        min-width: auto;
        margin-bottom: 4px;
    }
    
    .category-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .category-rating-btn {
        padding: 8px 12px;
        min-width: 40px;
        font-size: 12px;
    }
}

/* Feedback Modal Star Button Styling */
.feedback-star-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 0 2px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #495057;
}

.feedback-star-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.feedback-star-btn.selected {
    background: #28a745;
    border-color: #28a745;
    color: white;
    font-weight: 600;
}

.feedback-star-btn.selected:hover {
    background: #218838;
    border-color: #218838;
}

/* Edit Message Modal Styles */
.edit-modal {
    max-width: 600px;
    width: 90%;
}

.edit-modal-textarea {
    width: 100%;
    min-height: 250px;
    max-height: 400px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
    overflow-y: auto;
}

.edit-modal-textarea:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    outline: none;
}

.edit-modal .modal-header h3 {
    margin: 0;
    color: #333;
}

.edit-modal .modal-body {
    padding: 20px 0;
}

.edit-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
