/* Modern Transit Chat Styles */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #ff6b6b, #ee5a24);
    --success-gradient: linear-gradient(135deg, #28a745, #20c997);
    --user-gradient: linear-gradient(135deg, #007bff, #0056b3);
    --warning-gradient: linear-gradient(135deg, #ffc107, #fd7e14);
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #adb5bd;
    
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --border-radius-lg: 25px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.20);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.chat-container {
    width: calc(100vw - 20px);
    max-width: none;
    height: calc(100vh - 20px);
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header Styles */
.chat-header {
    background: var(--secondary-gradient);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.chat-header > * {
    position: relative;
    z-index: 1;
}

.chat-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    letter-spacing: -0.02em;
}

.chat-header p {
    opacity: 0.95;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

.ai-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator {
    position: absolute;
    top: 25px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
}

.status-dot.offline {
    background: #dc3545;
    animation: none;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.model-info {
    position: absolute;
    top: 70px;
    right: 30px;
    font-size: 0.8rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: var(--bg-secondary);
    position: relative;
}

.chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.chat-messages > * {
    position: relative;
    z-index: 1;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transition: var(--transition);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Map Container Styles */
.map-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    margin: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.map-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.map-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.map-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.map-display {
    height: 400px;
    width: 100%;
    position: relative;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile-first responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .chat-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    /* Minimal mobile header - just essentials */
    .chat-header {
        padding: 4px 8px;
        background: var(--primary-gradient);
        position: relative;
    }
    
    .chat-header h1 {
        font-size: 0.9rem;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }
    
    .chat-header h1 span[role="img"] {
        font-size: 0.8rem;
    }
    
    /* Hide AI badge on mobile - too much clutter */
    .ai-badge {
        display: none;
    }
    
    /* Hide description paragraph on mobile */
    .chat-header p {
        display: none;
    }
    
    /* Minimal status indicator in top corner */
    .status-indicator {
        position: absolute;
        top: 2px;
        right: 4px;
        background: rgba(255, 255, 255, 0.2);
        font-size: 0.5rem;
        padding: 1px 3px;
        border-radius: 6px;
        gap: 2px;
    }
    
    .status-dot {
        width: 4px;
        height: 4px;
    }
    
    /* Hide model info on mobile */
    .model-info {
        display: none;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .map-container {
        margin: 10px;
    }
    
    .map-display {
        height: 300px;
    }
}

@media (max-width: 480px) {
    /* Ultra-compact header for iPhone */
    .chat-header {
        padding: 6px 10px;
    }
    
    .chat-header h1 {
        font-size: 1rem;
        margin-bottom: 2px;
        gap: 6px;
    }
    
    .chat-header h1 span[role="img"] {
        font-size: 0.9rem;
    }
    
    .ai-badge {
        font-size: 0.55rem;
        padding: 2px 6px;
        border-radius: 10px;
    }
    
    .chat-header p {
        font-size: 0.7rem;
        line-height: 1.2;
        margin-bottom: 4px;
    }
    
    /* Even more compact status indicators */
    .status-indicator {
        font-size: 0.6rem;
        padding: 1px 4px;
        margin: 0 4px 0 0;
        border-radius: 8px;
        gap: 4px;
    }
    
    .status-dot {
        width: 6px;
        height: 6px;
    }
    
    .model-info {
        font-size: 0.6rem;
        padding: 1px 4px;
        border-radius: 8px;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .map-container {
        margin: 8px;
    }
    
    .map-display {
        height: 250px;
    }
    
    .map-header {
        padding: 12px 16px;
    }
    
    .map-header h3 {
        font-size: 1rem;
    }
}
