/**
 * Jacky 2.0 - Full-Screen Responsive Styles
 * Optimized for modern browsers with CSS Grid layout
 */

:root {
    --primary-color: #0052A5;
    --secondary-color: #00A4E4;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --header-height: clamp(60px, 8vh, 80px);
    
    /* Fluid typography scale - scales smoothly between mobile (375px) and desktop (1920px) */
    --font-size-xs: clamp(0.625rem, 0.5rem + 0.5vw, 0.75rem);      /* 10-12px */
    --font-size-sm: clamp(0.75rem, 0.65rem + 0.5vw, 0.875rem);     /* 12-14px */
    --font-size-base: clamp(0.875rem, 0.75rem + 0.5vw, 1rem);      /* 14-16px */
    --font-size-md: clamp(1rem, 0.85rem + 0.5vw, 1.125rem);        /* 16-18px */
    --font-size-lg: clamp(1.125rem, 0.95rem + 0.75vw, 1.5rem);     /* 18-24px */
    --font-size-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);         /* 24-40px */
    --font-size-2xl: clamp(2rem, 1.5rem + 2vw, 3.5rem);            /* 32-56px */
    
    /* Fluid spacing - scales with viewport */
    --spacing-xs: clamp(0.25rem, 0.5vw, 0.5rem);     /* 4-8px */
    --spacing-sm: clamp(0.5rem, 1vw, 1rem);          /* 8-16px */
    --spacing-md: clamp(0.75rem, 1.5vw, 1.5rem);     /* 12-24px */
    --spacing-lg: clamp(1rem, 2vw, 2rem);            /* 16-32px */
    --spacing-xl: clamp(1.5rem, 3vw, 3rem);          /* 24-48px */
    
    /* Fluid icon sizes */
    --icon-size-sm: clamp(1rem, 2vw, 1.5rem);        /* 16-24px */
    --icon-size-md: clamp(1.5rem, 3vw, 2.5rem);      /* 24-40px */
    --icon-size-lg: clamp(2rem, 4vw, 3.5rem);        /* 32-56px */
    
    /* Fluid border radius */
    --radius-sm: clamp(4px, 0.5vw, 8px);
    --radius-md: clamp(8px, 1vw, 16px);
    --radius-lg: clamp(12px, 1.5vw, 24px);
    
    /* Glassmorphism variables */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    /* New variables for dark mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-gradient-start: #f5f7fa;
    --bg-gradient-end: #c3cfe2;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #999;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --message-agent-bg: linear-gradient(135deg, #003d82 0%, #0052A5 100%);
    --message-user-bg: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    --message-user-text: #000;
}

/* Dark mode variables */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-gradient-start: #1a1a1a;
    --bg-gradient-end: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --card-bg: #2d2d2d;
    --input-bg: #3d3d3d;
    --border-color: #404040;
    --light-color: #2d2d2d;
    --message-agent-bg: linear-gradient(135deg, #1e3a5f 0%, #2d5a8f 100%);
    --message-user-bg: linear-gradient(135deg, #2d3d4f 0%, #3d4d5f 100%);
    --message-user-text: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    
    /* Dark mode glassmorphism */
    --glass-bg: rgba(45, 45, 45, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-size: 16px; /* Base font size for rem calculations */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    background: linear-gradient(-45deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    transition: color 0.3s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 128, 255, 0.3), transparent 50%),
                radial-gradient(circle at 40% 90%, rgba(0, 242, 254, 0.3), transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: floatingGlow 20s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes floatingGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

[data-theme="dark"] {
    background: linear-gradient(-45deg, #0f0c29 0%, #302b63 25%, #24243e 50%, #0f0c29 75%, #302b63 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

[data-theme="dark"]::before {
    background: radial-gradient(circle at 20% 50%, rgba(0, 164, 228, 0.2), transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(102, 126, 234, 0.2), transparent 50%),
                radial-gradient(circle at 40% 90%, rgba(118, 75, 162, 0.2), transparent 50%);
}

#app-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* COMPACT HEADER */
.app-header {
    height: var(--header-height);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    flex-shrink: 0;
    z-index: 100;
    gap: 2rem;
    transition: background 0.3s ease;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

/* Header scrollbar styling */
.app-header::-webkit-scrollbar {
    height: 6px;
}

.app-header::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.app-header::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.app-header::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.city-logo {
    height: 70px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.city-logo-dark {
    display: none;
}

[data-theme="dark"] .city-logo-light {
    display: none;
}

[data-theme="dark"] .city-logo-dark {
    display: block;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex-shrink: 0;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: -webkit-fill-available;
    min-width: -moz-available;
    min-width: fit-content;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.app-title {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

.app-subtitle {
    color: #6c757d;
    font-size: var(--font-size-base);
    line-height: 1.2;
    white-space: nowrap;
}

/* Star Rating in Header */
.star-rating-container-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: none;
}

.star-rating-label-header {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    transition: color 0.3s ease;
}

.star-rating-feedback-header {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-style: italic;
    white-space: nowrap;
    transition: color 0.3s ease;
}

/* Dark mode enhancements for star rating */
[data-theme="dark"] .star-rating-container-header {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

[data-theme="dark"] .star-rating-label-header {
    color: var(--text-primary);
}

[data-theme="dark"] .star-rating-feedback-header {
    color: var(--text-secondary);
}

/* Language Toggle Button - Side by Side Flags */
.language-toggle {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.language-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.2);
}

.flag-icon {
    width: 28px;
    height: auto;
    display: block;
    border-radius: 2px;
    border: 1px solid #e0e0e0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-color);
    border-radius: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning-color);
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success-color);
    animation: none;
}

.status-dot.error {
    background: var(--danger-color);
    animation: none;
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Small attribution text used in header/footer */
.powered-by {
    font-size: 0.75rem;
    color: #6c757d; /* muted */
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: transparent;
    white-space: nowrap;
}

.app-header .powered-by {
    margin-left: 0.75rem;
}

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

/* FULL-SCREEN TWO-PANEL LAYOUT */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(400px, 35%) 1fr;
    gap: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
    position: relative;
}

/* LEFT PANEL */
.left-panel {
    background: white;
    display: flex;
    flex-direction: column;
    border-right: none; /* Remove border for seamless look */
    overflow: hidden;
    align-items: stretch; /* Ensure children stretch to full width */
}

.avatar-container {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    margin: 0; /* Remove any default margin */
    padding: 0; /* Remove any default padding */
}

#anam-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 3;
    transition: opacity 0.5s ease;
}

.idle-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 1s ease;
    visibility: hidden;
    opacity: 0;
}

.idle-video-visible {
    visibility: visible;
    opacity: 1;
}

.anam-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    display: none;  /* Hidden initially, will be set to block when streaming */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.transcript-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 10;
}

/* Global utility class for hiding elements */
.hidden {
    display: none !important;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    margin-top: 1rem;
    font-size: 1rem;
}

.controls-container {
    padding: 1rem;
    background: var(--light-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 0;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.control-btn:not(:disabled):active {
    transform: translateY(0px);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.danger-btn {
    background: var(--danger-color);
    color: white;
}

.secondary-btn {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.info-panel {
    display: none; /* Hidden - moved to welcome message */
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #e7f3ff;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.info-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    stroke: var(--primary-color);
    fill: var(--primary-color);
}

.info-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

/* Info instruction in welcome message */
.info-instruction {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #e7f3ff;
    border-radius: 6px;
    border-left: 3px solid var(--secondary-color);
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

/* RIGHT PANEL */
.right-panel {
    background: var(--light-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0; /* Remove any padding for perfect alignment */
    margin: 0; /* Ensure no margin offset */
    position: relative; /* For absolute positioning of browser overlay */
}

.transcript-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    min-height: 200px;
    padding: 0;
    margin: 0;
    box-shadow: var(--glass-shadow);
}

.transcript-container h3 {
    padding: 0.75rem 1.5rem; /* Increased vertical padding for better height */
    margin: 0; /* Critical: no margin */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
    border-bottom: none; /* Remove border for seamless look */
    display: flex;
    align-items: center;
    line-height: 1; /* Tight line height for perfect alignment */
    position: relative;
    top: 0; /* Ensure flush with top */
}

.transcript {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    padding-top: 0; /* Remove top padding to connect with header */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.transcript::-webkit-scrollbar {
    width: 8px;
}

.transcript::-webkit-scrollbar-track {
    background: var(--light-color);
}

.transcript::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.transcript::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.welcome-message {
    text-align: center;
    padding: 1rem 1.5rem;
    color: #666;
    max-width: 500px;
    margin: auto;
}

.welcome-icon {
    font-size: 2rem;
    margin-bottom: 0.35rem;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    75% {
        transform: rotate(-20deg);
    }
}

.welcome-message h4 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.welcome-message p {
    line-height: 1.6;
    font-size: 1rem;
}

/* TRANSCRIPT MESSAGES */
.transcript-message {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
    margin-bottom: 1.5rem;
}

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

/* Agent messages on the LEFT */
.agent-message {
    align-items: flex-start;
}

/* User messages on the RIGHT */
.user-message {
    align-items: flex-end;
}

.message-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    padding: 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-bubble {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    word-wrap: break-word;
    position: relative;
}

.message-content {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    word-wrap: break-word;
    line-height: 1.6;
    font-size: var(--font-size-base);
    box-shadow: var(--glass-shadow);
    position: relative;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: #555;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.message-bubble:hover .copy-btn {
    opacity: 1;
    pointer-events: auto;
}

.copy-btn:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.copy-btn:active {
}

.copy-btn.copied {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

/* Agent message styling - Dark Blue with White Text */
.agent-message .message-content {
    background: linear-gradient(135deg, #003d82 0%, #0052A5 100%);
    color: white;
    border-bottom-left-radius: 4px;
    padding-right: 3rem; /* Extra padding for copy button */
}

.agent-message .copy-btn {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.agent-message .copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* User message styling - Light Blue with Black Text */
.user-message .message-content {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #000;
    border-bottom-right-radius: 4px;
    padding-right: 3rem; /* Extra padding for copy button */
}

.message-timestamp {
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.35rem;
    padding: 0 0.5rem;
    font-weight: 400;
}

/* INLINE SERVICE CARDS */
.message-service-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.message-service-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.message-service-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.message-service-card .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0.75rem 1rem;
}

.message-service-card .card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.message-service-card .card-body {
    padding: 1rem;
}

.message-service-card .card-body p {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;
}

.message-service-card .card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.message-service-card .card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: var(--light-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.message-service-card .card-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* QUICK SERVICE CARDS */
.service-cards-container {
    background: white;
    border-top: 3px solid var(--primary-color);
    padding: 0.5rem;
    height: auto;
    max-height: 35vh; /* Limit card area to give more space to transcript */
    overflow-y: visible;
    overflow-x: visible;
    flex-shrink: 0;
    display: block !important;
    position: relative;
}

/* Mobile scroll indicator */
@media (max-width: 768px) {
    .service-cards-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 45px;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
        pointer-events: none;
        z-index: 1;
    }
}

.service-cards-container h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.service-cards-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    gap: 0.75rem;
    padding: 0.5rem;
}

.service-cards-grid::-webkit-scrollbar {
    height: 8px;
}

.service-cards-grid::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 4px;
}

.service-cards-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.service-cards-grid::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Desktop: Horizontal scrollable carousel with fixed-width cards */
@media (min-width: 769px) {
    .service-cards-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;

        gap: var(--spacing-md);
        padding: var(--spacing-md) 0;
    }
    
    .service-card {
        flex: 0 0 clamp(120px, 15vw, 160px);
        min-width: clamp(120px, 15vw, 160px);
        max-width: clamp(120px, 15vw, 160px);
        scroll-snap-align: start;
    }
    
    .service-cards-grid::-webkit-scrollbar {
        height: 8px;
    }
    
    .service-cards-grid::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 4px;
    }
    
    .service-cards-grid::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 4px;
    }
    
    .service-cards-grid::-webkit-scrollbar-thumb:hover {
        background: var(--secondary-color);
    }
}

/* Large Desktop: Wider cards for better readability */
@media (min-width: 1200px) {
    .service-card {
        flex: 0 0 clamp(140px, 12vw, 180px);
        min-width: clamp(140px, 12vw, 180px);
        max-width: clamp(140px, 12vw, 180px);
    }
}

/* Mobile: Horizontal scrollable carousel */
@media (max-width: 768px) {
    .service-cards-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;

        gap: 0.75rem;
        padding: 0.5rem 0;
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .service-cards-grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .service-cards-grid::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
    }
    
    .service-cards-grid::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 3px;
    }
    
    .service-cards-grid::-webkit-scrollbar-thumb:hover {
        background: var(--secondary-color);
    }
    
    .service-card {
        flex: 0 0 140px;
        scroll-snap-align: start;
        min-width: 140px;
        max-width: 140px;
        min-height: 180px;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .service-card {
        flex: 0 0 130px;
        min-width: 130px;
        max-width: 130px;
        min-height: 170px;
        padding: 0.5rem 0.3rem;
    }
    
    .service-icon {
        font-size: 1.8rem;
    }
    
    .service-icon-svg {
        width: 2.2rem;
        height: 2.2rem;
    }
    
    .service-card h4 {
        font-size: 0.9rem;
    }
    
    .service-card p {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .service-link {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
        min-height: 32px; /* Touch-friendly tap target */
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .service-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .service-card:active {
        transform: scale(0.98);
    }
    
    .control-btn:active {
        transform: scale(0.95);
    }
    
    .service-link:active {
        transform: scale(0.95);
    }
}

.service-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: clamp(140px, 20vh, 180px);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 164, 228, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover {
    box-shadow: 0 12px 40px rgba(0, 164, 228, 0.3);
    border-color: rgba(0, 164, 228, 0.5);
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .service-card:hover {
    background: rgba(45, 45, 45, 0.9);
}

.service-card:hover::before {
    opacity: 1;
}

/* Temporary highlight when a service card is opened via voice command - removed pulse/sonar effect */
.service-card-opening {
    transform: scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 164, 228, 0.45) !important;
    border-color: var(--primary-color) !important;
    z-index: 50;
}

/* Enhanced hover tooltip - desktop only */
@media (min-width: 1025px) {
    .service-card {
        position: relative;
    }
    
    .service-card::after {
        content: attr(data-description);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        background: rgba(0, 0, 0, 0.95);
        color: white;
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-sm);
        font-size: var(--font-size-sm);
        white-space: normal;
        max-width: clamp(200px, 30vw, 300px);
        text-align: center;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease;
        z-index: 1000;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }
    
    .service-card:hover::after {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
    
    /* Tooltip arrow */
    .service-card[data-description]::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: clamp(5px, 0.8vw, 7px) solid transparent;
        border-top-color: rgba(0, 0, 0, 0.95);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1001;
    }
    
    .service-card:hover[data-description]::before {
        opacity: 1;
    }
}

/* Speed up Lottie animation on hover */
.service-card:hover .service-lottie {
    animation: lottieSpeedUp 0.3s ease-in-out;
}

@keyframes lottieSpeedUp {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15) rotate(5deg);
    }
}

.service-icon {
    font-size: var(--icon-size-md);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.service-icon-svg {
    width: var(--icon-size-md);
    height: var(--icon-size-md);
    margin-bottom: var(--spacing-xs);
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.service-card h4 {
    color: var(--primary-color);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    line-height: 1.2;
}

.service-card p {
    font-size: var(--font-size-sm);
    color: #666;
    line-height: 1.3;
    margin-bottom: var(--spacing-xs);
    flex-grow: 1;
    display: none !important; /* Hide descriptions on all screen sizes */
}

.service-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-top: auto;
    padding-top: var(--spacing-xs);
}

.service-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: 1.5px solid var(--primary-color);
    transition: all 0.2s ease;
}

.service-link:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 82, 165, 0.3);
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* RESPONSIVE - FLUID ADAPTIVE DESIGN */

/* Extra large desktops */
/* Extra large desktops - USE FULL SCREEN */
@media (min-width: 1920px) {
    .main-content {
        width: 100%;
        /* Removed max-width and margin to use full screen real estate */
    }
    
    .app-header {
        width: 100%;
        /* Removed max-width and margin to use full screen real estate */
    }
    
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Large desktops */
@media (min-width: 1440px) and (max-width: 1919px) {
    .main-content {
        grid-template-columns: minmax(450px, 35%) 1fr;
    }
    
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Standard desktops */
@media (min-width: 1200px) and (max-width: 1439px) {
    .main-content {
        grid-template-columns: minmax(400px, 38%) 1fr;
    }
    
    .app-title {
        font-size: 1.9rem;
    }
    
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    }
}

/* Small desktops / Large tablets */
@media (min-width: 1025px) and (max-width: 1199px) {
    .main-content {
        grid-template-columns: minmax(380px, 40%) 1fr;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
    
    .city-logo {
        height: 65px;
    }
    
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: minmax(350px, 42%) 1fr;
    }
    .app-subtitle {
        display: none;
    }
    
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    }
}

/* Landscape tablets */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .main-content {
        grid-template-columns: 45% 1fr;
    }
    
    .avatar-container {
        min-height: 250px;
    }
}

/* Portrait tablets */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: 40% 1fr;
    }
    
    .left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
    }
    .app-title {
        font-size: 1.5rem;
    }
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(250px, 40%) 1fr;
    }
    .left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .avatar-container {
        min-height: 200px;
    }
    .controls-container {
        padding: 1rem;
    }
    .control-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    .info-panel {
        padding: 1rem;
    }
    .transcript-container h3 {
        padding: 1rem;
        font-size: 1rem;
    }
    .transcript {
        padding: 1rem;
    }
    .message-bubble {
        max-width: 85%;
    }
    .message-service-card .card-links {
        flex-direction: column;
    }
    .message-service-card .card-link {
        justify-content: center;
        width: 100%;
    }
    /* Tablet: Use grid with larger cards */
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
}

/* Medium tablets and larger phones */
/* Medium tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .app-header {
        height: 65px;
        padding: 0 0.75rem;
    }
    
    .city-logo {
        height: 48px;
    }
    
    .app-title {
        font-size: 1.3rem;
    }
    
    .app-subtitle {
        font-size: 0.8rem;
    }
    
    /* Show compact star rating on tablets */
    .star-rating-container-header {
        padding: 0.4rem 0.75rem;
        gap: 0.5rem;
    }
    
    .star-rating-label-header {
        font-size: 0.75rem;
    }
    
    .star-rating-feedback-header {
        font-size: 0.65rem;
    }
    
    .star-rating-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .main-content {
        grid-template-rows: minmax(180px, 30%) 1fr;
    }
    
    .avatar-container {
        min-height: 180px;
    }
    
    .control-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .service-card {
        flex: 0 0 110px;
        min-width: 110px;
        max-width: 110px;
        min-height: 140px;
    }
    
    .service-icon {
        font-size: 1.6rem;
    }
    
    .service-card h4 {
        font-size: 0.8rem;
    }
    
    .service-card p {
        font-size: 0.68rem;
    }
}

/* Large phones */
@media (min-width: 376px) and (max-width: 480px) {
    .app-header {
        height: 58px;
    }
    
    .city-logo {
        height: 38px;
    }
    
    .app-title {
        font-size: 1.15rem;
    }
    
    .app-subtitle {
        font-size: 0.7rem;
    }
    
    .main-content {
        height: calc(100vh - 58px);
        grid-template-rows: minmax(130px, 24%) 1fr;
    }
    
    .avatar-container {
        min-height: 130px;
    }
    
    .service-card {
        flex: 0 0 95px;
        min-width: 95px;
        max-width: 95px;
        min-height: 125px;
    }
    
    .service-icon {
        font-size: 1.4rem;
    }
    
    .service-card h4 {
        font-size: 0.72rem;
    }
    
    .service-card p {
        font-size: 0.62rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        height: 55px;
        padding: 0;
        gap: 0.5rem;
        grid-template-columns: none; /* Remove grid on mobile */
        display: flex; /* Use flexbox for horizontal scroll */
        overflow-x: auto; /* Enable horizontal scrolling */
        overflow-y: hidden;
        scroll-behavior: smooth;
        /* Hide scrollbar but keep functionality */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        position: relative;
    }
    
    .app-header::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Opera */
    }
    
    /* Subtle gradient to indicate scrollable content */
    .app-header::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, var(--bg-primary), transparent);
        pointer-events: none;
        z-index: 1;
    }
    
    .header-left {
        gap: 0.5rem;
        flex-shrink: 0; /* Prevent shrinking */
        padding-left: 0.5rem;
    }
    
    .city-logo {
        height: 35px;
        flex-shrink: 0;
    }
    
    .header-text {
        flex-shrink: 0;
    }
    
    .app-title {
        font-size: 1.1rem;
        line-height: 1;
        white-space: nowrap;
    }
    
    .app-subtitle {
        font-size: 0.65rem;
        white-space: nowrap;
    }
    
    /* Show star rating but hide text labels on mobile */
    .header-center {
        display: flex;
        justify-content: center;
        flex-shrink: 0;
        padding: 0 0.5rem;
    }
    
    .star-rating-container-header {
        padding: 0.35rem 0.5rem;
        gap: 0.3rem;
        flex-shrink: 0;
    }
    
    .star-rating-label-header,
    .star-rating-feedback-header {
        display: none; /* Hide text labels on mobile */
    }
    
    .star-rating-btn {
        padding: 0.15rem;
        flex-shrink: 0;
    }
    
    .star-rating-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .header-right {
        gap: 0.4rem;
        flex-shrink: 0;
        padding-right: 0.5rem;
        position: relative;
        z-index: 2; /* Above gradient */
    }
    
    .dark-mode-toggle,
    .language-toggle {
        flex-shrink: 0;
    }
    
    .powered-by {
        display: none; /* Hide on small mobile */
    }
    
    .status-indicator {
        display: none; /* Hide status text on small mobile */
    }
    
    .status-text {
        font-size: 0.7rem;
    }
    
    /* Optimize for portrait: Avatar takes less space, controls always visible */
    .main-content {
        height: calc(100vh - 55px);
        grid-template-rows: auto 1fr; /* Changed to auto to fit content */
    }
    
    .left-panel {
        display: flex;
        flex-direction: column;
        min-height: 0; /* Allow flexible sizing */
    }
    
    .avatar-container {
        min-height: 100px; /* Smaller minimum on mobile */
        max-height: 150px; /* Cap avatar height to ensure controls visible */
        flex-shrink: 1;
    }
    
    .controls-container {
        gap: 0.4rem;
        padding: 0.5rem;
        flex-shrink: 0; /* Never shrink - always show Start button */
        min-height: fit-content;
    }
    
    .control-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        flex: 1;
        min-width: 90px;
    }
    
    .btn-icon {
        width: 16px;
        height: 16px;
    }
    
    .service-card {
        flex: 0 0 100px;
        min-width: 100px;
        max-width: 100px;
        min-height: 110px; /* Reduced since no description */
        padding: 0.5rem;
    }
    
    .service-icon {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }
    
    .service-card h4 {
        font-size: 0.7rem;
        margin-bottom: 0.35rem;
    }
    
    .service-card p {
        display: none !important; /* Hide description on mobile */
    }
    
    .service-card .card-link {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
        margin-top: 0.35rem;
    }
    
    .message-bubble {
        max-width: 92%;
    }
    
    .message-content {
        padding: 0.75rem 0.85rem;
        font-size: 0.85rem;
    }
    
    .message-label {
        font-size: 0.65rem;
    }
    
    .message-timestamp {
        font-size: 0.6rem;
    }
    
    .transcript-container {
        padding: 0.5rem;
    }
    
    /* Mobile already has horizontal scroll defined above */
}

/* Very small phones (375px and below) */
@media (max-width: 375px) {
    .app-header {
        height: 52px;
        padding: 0;
        gap: 0.4rem;
        grid-template-columns: none; /* Remove grid */
        display: flex; /* Flexbox for scroll */
        overflow-x: auto;
        overflow-y: hidden;

        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        position: relative;
    }
    
    .app-header::-webkit-scrollbar {
        display: none;
    }
    
    /* Subtle gradient to indicate scrollable content */
    .app-header::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 15px;
        background: linear-gradient(to left, var(--bg-primary), transparent);
        pointer-events: none;
        z-index: 1;
    }
    
    .header-left {
        gap: 0.4rem;
        flex-shrink: 0;
        padding-left: 0.4rem;
    }
    
    .header-text {
        flex-shrink: 0;
    }
    
    .city-logo {
        height: 32px;
        flex-shrink: 0;
    }
    
    .app-title {
        font-size: 1rem;
        white-space: nowrap;
    }
    
    .app-subtitle {
        font-size: 0.6rem;
        white-space: nowrap;
    }
    
    .header-center {
        flex-shrink: 0;
        padding: 0 0.4rem;
    }
    
    .star-rating-container-header {
        flex-shrink: 0;
    }
    
    .header-right {
        gap: 0.3rem;
        flex-shrink: 0;
        padding-right: 0.4rem;
        position: relative;
        z-index: 2; /* Above gradient */
    }
    
    .dark-mode-toggle,
    .language-toggle {
        transform: scale(0.9); /* Slightly smaller on very small screens */
        flex-shrink: 0;
    }
    
    .main-content {
        height: calc(100vh - 52px);
        grid-template-rows: minmax(110px, 20%) 1fr;
    }
    
    .avatar-container {
        min-height: 110px;
    }
    
    .control-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.7rem;
        min-width: 80px;
    }
    
    .btn-icon {
        width: 14px;
        height: 14px;
    }
    
    .service-card {
        flex: 0 0 90px;
        min-width: 90px;
        max-width: 90px;
        min-height: 100px; /* Reduced since no description */
        padding: 0.4rem;
    }
    
    .service-icon {
        font-size: 1.3rem;
    }
    
    .service-card h4 {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }
    
    .service-card p {
        display: none !important; /* Hide description on mobile */
    }
    
    .service-card .card-link {
        font-size: 0.6rem;
        padding: 0.25rem 0.4rem;
    }
    
    .transcript-container {
        padding: 0.4rem;
    }
    
    .message-content {
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Extra small phones (320px and below) */
@media (max-width: 320px) {
    .app-header {
        height: 50px;
        padding: 0 0.4rem;
    }
    
    .city-logo {
        height: 30px;
    }
    
    .app-title {
        font-size: 0.95rem;
    }
    
    .app-subtitle {
        font-size: 0.55rem;
    }
    
    .header-left {
        gap: 0.4rem;
    }
    
    .main-content {
        height: calc(100vh - 50px);
        grid-template-rows: minmax(100px, 18%) 1fr;
    }
    
    .avatar-container {
        min-height: 100px;
    }
    
    .service-card {
        flex: 0 0 85px;
        min-width: 85px;
        max-width: 85px;
        min-height: 95px; /* Reduced since no description */
        padding: 0.35rem;
    }
    
    .service-icon {
        font-size: 1.2rem;
    }
    
    .service-card h4 {
        font-size: 0.6rem;
        margin-bottom: 0.25rem;
    }
    
    .service-card p {
        display: none !important; /* Hide description on mobile */
    }
    
    .service-card .card-link {
        font-size: 0.55rem;
        padding: 0.2rem 0.35rem;
    }
    
    .control-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
        min-width: 75px;
    }
    
    .btn-icon {
        width: 12px;
        height: 12px;
    }
}

/* Landscape mode optimizations for short screens */
@media (max-height: 500px) and (orientation: landscape) {
    .app-header {
        height: 45px;
        padding: 0 0.5rem;
        gap: 1rem;
    }
    
    .city-logo {
        height: 30px;
    }
    
    .app-title {
        font-size: 0.95rem;
    }
    
    .app-subtitle {
        font-size: 0.6rem;
    }
    
    .header-center {
        display: none; /* Hide rating in landscape for space */
    }
    
    .main-content {
        height: calc(100vh - 45px);
        grid-template-columns: 30% 1fr;
        grid-template-rows: 1fr;
    }
    
    .left-panel {
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        overflow-y: auto;
    }
    
    .avatar-container {
        min-height: 80px;
        max-height: 150px;
        flex: 0 0 auto;
    }
    
    .controls-container {
        padding: 0.35rem 0.4rem;
        gap: 0.3rem;
        flex: 0 0 auto;
    }
    
    .control-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
        min-width: 70px;
    }
    
    .btn-icon {
        width: 12px;
        height: 12px;
    }
    
    .right-panel {
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    .transcript-container {
        padding: 0.4rem;
        flex: 1;
        overflow-y: auto;
    }
    
    .message-content {
        padding: 0.5rem 0.65rem;
        font-size: 0.75rem;
    }
    
    .message-label {
        font-size: 0.6rem;
    }
    
    .message-timestamp {
        font-size: 0.5rem;
    }
    
    .service-cards-section {
        flex: 0 0 auto;
    }
    
    .service-cards-container {
        padding: 0.4rem;
        max-height: 35vh;
        overflow-x: auto;
    }
    
    .service-card {
        flex: 0 0 80px;
        min-width: 80px;
        max-width: 80px;
        min-height: 95px; /* Reduced since no description */
        padding: 0.35rem;
    }
    
    .service-icon {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
    }
    
    .service-card h4 {
        font-size: 0.6rem;
        margin-bottom: 0.25rem;
    }
    
    .service-card p {
        display: none !important; /* Hide description in landscape */
    }
    
    .service-card .card-link {
        font-size: 0.55rem;
        padding: 0.2rem 0.35rem;
    }
    
    .section-title {
        font-size: 0.85rem;
        padding: 0.4rem;
    }
}

/* Mobile landscape mode (phones in landscape) - More specific */
@media (max-width: 896px) and (max-height: 414px) and (orientation: landscape) {
    .app-header {
        height: 42px;
        padding: 0 0.5rem;
        gap: 0.75rem;
    }
    
    .header-center {
        display: none; /* Hide rating to save space */
    }
    
    .city-logo {
        height: 28px;
    }
    
    .app-title {
        font-size: 0.9rem;
    }
    
    .app-subtitle {
        font-size: 0.6rem;
    }
    
    .main-content {
        height: calc(100vh - 42px);
        grid-template-columns: 28% 1fr;
    }
    
    .left-panel {
        overflow-y: auto;
    }
    
    .avatar-container {
        min-height: 70px;
        max-height: 130px;
        flex: 0 0 auto;
    }
    
    .controls-container {
        padding: 0.3rem;
        gap: 0.3rem;
        flex: 0 0 auto;
    }
    
    .control-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
        min-width: 65px;
    }
    
    .btn-icon {
        width: 11px;
        height: 11px;
    }
    
    .right-panel {
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    .transcript-container {
        flex: 1;
        padding: 0.35rem;
        overflow-y: auto;
    }
    
    .message-content {
        padding: 0.45rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .message-label {
        font-size: 0.55rem;
    }
    
    .message-timestamp {
        font-size: 0.48rem;
    }
    
    .service-cards-section {
        flex: 0 0 auto;
    }
    
    .service-cards-container {
        padding: 0.35rem;
        max-height: 32vh;
    }
    
    .service-card {
        flex: 0 0 75px;
        min-width: 75px;
        max-width: 75px;
        min-height: 90px; /* Reduced since no description */
        padding: 0.3rem;
    }
    
    .service-icon {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
    }
    
    .service-card h4 {
        font-size: 0.55rem;
        margin-bottom: 0.25rem;
    }
    
    .service-card p {
        display: none !important; /* Hide description in mobile landscape */
    }
    
    .service-card .card-link {
        font-size: 0.5rem;
        padding: 0.18rem 0.3rem;
    }
    
    .section-title {
        font-size: 0.8rem;
        padding: 0.35rem;
    }
}

/* ============================================
   Feedback System Styles
   ============================================ */

/* Message Feedback Buttons (Thumbs Up/Down) */
.message-feedback {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.feedback-btn {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-btn:hover {
    opacity: 0.9;
}

.feedback-thumbs-up:hover {
    background: #28a745;
    border-color: #28a745;
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.feedback-thumbs-up.feedback-active {
    background: #28a745;
    border-color: #28a745;
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.feedback-thumbs-down:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.feedback-thumbs-down.feedback-active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Star Rating Container - Legacy (now moved to header) */
.star-rating-container {
    display: none !important; /* Hidden - now in header */
}

.star-rating-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-direction: row; /* Normal left-to-right order */
}

.star-rating-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    color: #ddd;
    transition: all 0.3s ease;
    transform: scale(1);
}

.star-rating-btn svg {
    width: var(--icon-size-sm);
    height: var(--icon-size-sm);
}

.star-rating-btn:hover {
    opacity: 0.9;
}

/* Enhanced hover glow for dark mode */
[data-theme="dark"] .star-rating-btn:hover {
    filter: brightness(1.3) drop-shadow(0 0 8px currentColor) !important;
}

/* When stars are active, ALL stars with the same rating class get the same color */
/* 1-star rating: RED */
.star-rating-btn.star-active.rating-1 {
    color: #ff0000 !important;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.6)) brightness(1.2) !important;
}

/* 2-star rating: DARK ORANGE */
.star-rating-btn.star-active.rating-2 {
    color: #ff8c00 !important;
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.6)) brightness(1.2) !important;
}

/* 3-star rating: YELLOW */
.star-rating-btn.star-active.rating-3 {
    color: #ffd700 !important;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)) brightness(1.2) !important;
}

/* 4-star rating: LIGHT GREEN */
.star-rating-btn.star-active.rating-4 {
    color: #90ee90 !important;
    filter: drop-shadow(0 0 8px rgba(144, 238, 144, 0.6)) brightness(1.2) !important;
}

/* 5-star rating: DARK GREEN */
.star-rating-btn.star-active.rating-5 {
    color: #006400 !important;
    filter: drop-shadow(0 0 8px rgba(0, 100, 0, 0.6)) brightness(1.2) !important;
}

/* Dark mode active stars - enhanced brightness, all stars same color per rating */
[data-theme="dark"] .star-rating-btn.star-active.rating-1 {
    color: #ff0000 !important;
    filter: drop-shadow(0 0 16px rgba(255, 0, 0, 0.9)) brightness(1.5) !important;
}

[data-theme="dark"] .star-rating-btn.star-active.rating-2 {
    color: #ff8c00 !important;
    filter: drop-shadow(0 0 16px rgba(255, 140, 0, 0.9)) brightness(1.5) !important;
}

[data-theme="dark"] .star-rating-btn.star-active.rating-3 {
    color: #ffd700 !important;
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.9)) brightness(1.5) !important;
}

[data-theme="dark"] .star-rating-btn.star-active.rating-4 {
    color: #32cd32 !important;
    filter: drop-shadow(0 0 16px rgba(50, 205, 50, 0.9)) brightness(1.6) !important;
}

[data-theme="dark"] .star-rating-btn.star-active.rating-5 {
    color: #228b22 !important;
    filter: drop-shadow(0 0 16px rgba(34, 139, 34, 0.9)) brightness(1.5) !important;
}

/* Hover effects - all hovered stars show same color based on rating */
.star-rating-btn.hover-1 {
    color: #ff0000 !important;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.6)) brightness(1.2) !important;
}

.star-rating-btn.hover-2 {
    color: #ff8c00 !important;
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.6)) brightness(1.2) !important;
}

.star-rating-btn.hover-3 {
    color: #ffd700 !important;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)) brightness(1.2) !important;
}

.star-rating-btn.hover-4 {
    color: #90ee90 !important;
    filter: drop-shadow(0 0 8px rgba(144, 238, 144, 0.6)) brightness(1.2) !important;
}

.star-rating-btn.hover-5 {
    color: #006400 !important;
    filter: drop-shadow(0 0 8px rgba(0, 100, 0, 0.6)) brightness(1.2) !important;
}

/* Dark mode hover effects - ultra bright glow */
[data-theme="dark"] .star-rating-btn.hover-1 {
    color: #ff0000 !important;
    filter: drop-shadow(0 0 20px rgba(255, 0, 0, 1)) brightness(1.8) !important;
}

[data-theme="dark"] .star-rating-btn.hover-2 {
    color: #ff8c00 !important;
    filter: drop-shadow(0 0 20px rgba(255, 140, 0, 1)) brightness(1.8) !important;
}

[data-theme="dark"] .star-rating-btn.hover-3 {
    color: #ffd700 !important;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1)) brightness(1.8) !important;
}

[data-theme="dark"] .star-rating-btn.hover-4 {
    color: #32cd32 !important;
    filter: drop-shadow(0 0 20px rgba(50, 205, 50, 1)) brightness(1.9) !important;
}

[data-theme="dark"] .star-rating-btn.hover-5 {
    color: #228b22 !important;
    filter: drop-shadow(0 0 20px rgba(34, 139, 34, 1)) brightness(1.8) !important;
}

.star-rating-feedback {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

.star-rating-btn svg {
    display: block;
    transition: all 0.3s ease;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.toast.toast-success {
    border-left-color: var(--success-color);
}

.toast.toast-error {
    border-left-color: var(--danger-color);
}

.toast.toast-warning {
    border-left-color: var(--warning-color);
}

.toast.toast-info {
    border-left-color: var(--secondary-color);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-exit {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ============================================
   STATUS BADGE ON AVATAR
   ============================================ */

.avatar-container {
    position: relative;
}

.status-badge {
    display: none;
    position: absolute;
    bottom: 10%;
    right: 10%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.status-badge.status-disconnected {
    background-color: var(--danger-color);
    animation: none;
}

.status-badge.status-connecting {
    background-color: var(--warning-color);
    animation: pulse-badge 1.5s ease-in-out infinite;
}

.status-badge.status-connected {
    background-color: var(--success-color);
    animation: none;
}

.status-badge.status-speaking {
    background-color: var(--secondary-color);
    animation: pulse-badge 1s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ============================================
   SKELETON LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--border-color) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

.skeleton-avatar {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.skeleton-card {
    height: 120px;
    margin-bottom: 0.5rem;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

/* ============================================
   DARK MODE TOGGLE
   ============================================ */

.dark-mode-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all 0.3s ease;
    position: relative;
    width: clamp(50px, 8vw, 65px);
    height: clamp(28px, 4vw, 34px);
}

.dark-mode-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.dark-mode-toggle-slider {
    position: absolute;
    width: clamp(22px, 3.5vw, 26px);
    height: clamp(22px, 3.5vw, 26px);
    background: var(--primary-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    left: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xs);
    pointer-events: none; /* Allow clicks to pass through to button */
}

[data-theme="dark"] .dark-mode-toggle-slider {
    left: 31px;
    background: var(--secondary-color);
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Button ripple effect */
.control-btn, .service-link, .quick-action-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.control-btn:not(:disabled):active,
.service-link:active,
.quick-action-btn:active {
    transform: scale(0.97);
}

/* Card lift effect */
.service-card,
.message-service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover,
.message-service-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Smooth focus indicators */
input:focus,
textarea:focus,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    transition: outline 0.2s ease;
}

/* Icon animations */
.btn-icon,
.info-icon {
    transition: transform 0.3s ease;
}

.control-btn:hover .btn-icon {
    transform: scale(1.1);
}

/* Copy button enhancement */
.copy-btn {
    transition: all 0.2s ease;
}

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

/* Star rating smooth transitions */
.star-rating-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.star-rating-btn:hover {
    opacity: 0.9;
}

/* Message fade-in animation */
.transcript-message {
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Feedback button pulse on click */
.feedback-btn:active {
    animation: buttonPulse 0.3s ease;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
}

/* ============================================
   MESSAGE ACTIONS HOVER ENHANCEMENT
   ============================================ */

.copy-btn,
.feedback-buttons {
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.message-bubble:hover .copy-btn,
.message-bubble:hover .feedback-buttons {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile: Always show actions */
@media (max-width: 768px) {
    .copy-btn,
    .feedback-buttons {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ============================================
   DARK MODE ADJUSTMENTS FOR EXISTING ELEMENTS
   ============================================ */

[data-theme="dark"] .app-title {
    color: var(--secondary-color);
}

[data-theme="dark"] .app-subtitle {
    color: var(--text-secondary);
}

[data-theme="dark"] .status-indicator {
    background: var(--bg-secondary);
}

[data-theme="dark"] .transcript {
    background: var(--bg-primary);
}

[data-theme="dark"] .welcome-message {
    color: var(--text-secondary);
}

[data-theme="dark"] .welcome-message h4 {
    color: var(--secondary-color);
}

[data-theme="dark"] .agent-message .message-content {
    background: var(--message-agent-bg);
    color: white;
}

[data-theme="dark"] .user-message .message-content {
    background: var(--message-user-bg);
    color: var(--message-user-text);
}

[data-theme="dark"] .control-btn.secondary-btn {
    background: var(--card-bg);
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

[data-theme="dark"] .info-panel {
    background: var(--card-bg);
}

[data-theme="dark"] .service-cards-container {
    background: var(--card-bg);
}

[data-theme="dark"] .left-panel {
    background: var(--bg-primary);
}

[data-theme="dark"] .right-panel {
    background: var(--bg-secondary);
}

[data-theme="dark"] .transcript-container {
    background: var(--card-bg);
}

/* ============================================================
   GRADIENT BACKGROUNDS & GLASS MORPHISM ENHANCEMENTS
   ============================================================ */

/* Enhanced gradient background for body */
body {
    background: linear-gradient(135deg, 
        #f5f7fa 0%, 
        #e8ecf1 25%, 
        #dde5ef 50%, 
        #c3cfe2 100%
    );
    background-attachment: fixed;
}

[data-theme="dark"] {
    background: linear-gradient(135deg, 
        #0f0f0f 0%, 
        #1a1a1a 25%, 
        #242424 50%, 
        #2d2d2d 100%
    );
    background-attachment: fixed;
}

/* Subtle gradient overlay for main content area */
.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(0, 164, 228, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.main-content > * {
    position: relative;
    z-index: 1;
}

/* Animated gradient on Start Conversation button */
.primary-btn {
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 50%, 
        var(--primary-color) 100%
    );
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Shimmer effect on hover */
.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    transition: left 0.5s;
}

.primary-btn:hover::before {
    left: 100%;
}

/* Metallic blue border on service cards hover */
.service-card:hover {
    border: 2px solid #00A4E4;
    background: linear-gradient(135deg, 
        rgba(0, 164, 228, 0.15) 0%,
        rgba(100, 200, 240, 0.25) 50%,
        rgba(0, 164, 228, 0.15) 100%
    );
    box-shadow: 0 4px 16px rgba(0, 164, 228, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.5),
                inset 0 -1px 0 rgba(0, 164, 228, 0.3);
}

/* Keep message bubble hover subtle */
.message-bubble:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Glass morphism on modals */
.modal {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .modal-content {
    background: rgba(45, 45, 45, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Glass effect on error modal */
#error-modal .modal-content {
    background: rgba(255, 245, 245, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] #error-modal .modal-content {
    background: rgba(60, 30, 30, 0.95);
}

/* Glass effect on toast notifications */
.toast {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .toast {
    background: rgba(45, 45, 45, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Frosted glass effect on avatar container overlay */
.loading-overlay {
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Subtle gradient on service cards */
.service-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(248, 249, 250, 1) 100%
    );
}

/* Gradient text for headers (optional enhancement) */
.app-title {
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulsing glow effect on active conversation */
.avatar-container.speaking {
    box-shadow: 0 0 30px rgba(0, 164, 228, 0.4),
                inset 0 0 30px rgba(0, 164, 228, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 164, 228, 0.4),
                    inset 0 0 30px rgba(0, 164, 228, 0.2);
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 164, 228, 0.6),
                    inset 0 0 50px rgba(0, 164, 228, 0.3);
    }
}

/* Gradient on status badge */
.status-badge.status-connected {
    background: linear-gradient(135deg, 
        var(--success-color) 0%, 
        #20c997 100%
    );
}

/* Glass effect on header */
.app-header {
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .app-header {
    background: rgba(26, 26, 26, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Floating gradient shadow on hover for important buttons */
.control-btn:not(:disabled):hover {
    box-shadow: 0 8px 24px rgba(0, 82, 165, 0.25),
                0 4px 8px rgba(0, 82, 165, 0.1);
}

[data-theme="dark"] .control-btn:not(:disabled):hover {
    box-shadow: 0 8px 24px rgba(0, 164, 228, 0.3),
                0 4px 8px rgba(0, 164, 228, 0.15);
}

/* Enhanced gradient for transcript messages */
.message-bubble.agent {
    background: linear-gradient(135deg, 
        #003d82 0%, 
        #0052A5 50%, 
        #003d82 100%
    );
    background-size: 200% 100%;
}

.message-bubble.user {
    background: linear-gradient(135deg, 
        #e3f2fd 0%, 
        #bbdefb 50%, 
        #e3f2fd 100%
    );
    background-size: 200% 100%;
}

/* Subtle animation on message appearance */
@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble {
    animation: message-appear 0.3s ease-out;
}

/* ============================================
   Responsive Adjustments for UI Components
   ============================================ */

/* Feedback buttons responsiveness */
@media (max-width: 768px) {
    .feedback-btn {
        padding: 0.3rem 0.45rem;
        font-size: 0.9rem;
    }
    
    .message-feedback {
        gap: 0.4rem;
    }
}

@media (max-width: 480px) {
    .feedback-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.85rem;
    }
    
    .message-feedback {
        gap: 0.3rem;
        margin-top: 0.4rem;
        padding-top: 0.4rem;
    }
}

/* Transcript responsiveness */
@media (min-width: 1440px) {
    .transcript-container {
        padding: 0;
    }
    
    .message-content {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .transcript-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .transcript-container {
        padding: 0.75rem;
    }
}

/* Controls responsiveness */
@media (min-width: 1440px) {
    .controls-container {
        padding: 1rem;
        gap: 1rem;
    }
    
    .control-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 1024px) {
    .controls-container {
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .controls-container {
        padding: 0.75rem;
        gap: 0.6rem;
    }
}

/* Avatar container responsiveness */
@media (min-width: 1440px) {
    .avatar-container {
        min-height: 300px;
    }
}

@media (max-width: 1024px) {
    .avatar-container {
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .avatar-container {
        min-height: 180px;
    }
}

@media (max-width: 480px) {
    .avatar-container {
        min-height: 160px;
    }
}

/* Status indicator responsiveness */
@media (max-width: 768px) {
    .status-indicator {
        font-size: 0.8rem;
    }
    
    .status-dot {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .status-indicator {
        font-size: 0.75rem;
    }
    
    .status-dot {
        width: 7px;
        height: 7px;
    }
}

/* Language switcher responsiveness */
@media (max-width: 768px) {
    .language-switcher select {
        padding: 0.45rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Reset header flex layout on mobile to prevent overlap */
    .header-left,
    .header-center,
    .header-right {
        flex: 0 0 auto;
        min-width: auto;
    }
    
    .header-left {
        flex-shrink: 0;
    }
    
    .header-center {
        flex-shrink: 0;
    }
    
    .header-right {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .language-switcher select {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
}

/* Smooth transition for all responsive changes */
* {
    transition: font-size 0.2s ease, padding 0.2s ease, margin 0.2s ease, width 0.2s ease, height 0.2s ease;
}

/* Exclude animations and transforms from smooth transition */
*:not(.service-card):not(.control-btn):not(.feedback-btn):not(.star-rating-btn) {
    transition: font-size 0.2s ease, padding 0.2s ease, margin 0.2s ease;
}

/* ============================================
   🎨 ADVANCED ANIMATIONS & EFFECTS
   ============================================ */

/* 1. BREATHING ANIMATION ON PRIMARY BUTTON */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(0, 82, 165, 0.3);
    }
}

.primary-btn:not(:disabled) {
    animation: breathe 3s ease-in-out infinite;
}

/* Stop breathing when hovering */
.primary-btn:not(:disabled):hover {
    animation: none;
}

/* 2. SHINING EFFECT ON "POWERED BY DR. STEVEN SIERRA ALCABES" */
.powered-by {
    position: relative;
    background: linear-gradient(
        90deg,
        #6c757d 0%,
        #8b95a1 25%,
        #b8c1cc 50%,
        #8b95a1 75%,
        #6c757d 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 3s linear infinite;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

[data-theme="dark"] .powered-by {
    background: linear-gradient(
        90deg,
        #9ca3af 0%,
        #d1d5db 25%,
        #f3f4f6 50%,
        #d1d5db 75%,
        #9ca3af 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 3. 3D PARALLAX TILT EFFECT ON SERVICE CARDS */
.service-card {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Metallic blue gradient overlay for hover */
.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(0, 164, 228, 0.2) 40%,
        rgba(100, 200, 240, 0.4) 50%,
        rgba(0, 164, 228, 0.2) 60%,
        transparent 70%
    );
    transform: rotate(0deg);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.service-card:hover::before {
    opacity: 1;
    animation: metallic-shine 2s linear infinite;
}

@keyframes metallic-shine {
    0% {
        transform: rotate(0deg) translate(-50%, -50%);
    }
    100% {
        transform: rotate(360deg) translate(-50%, -50%);
    }
}

/* Enhanced metallic blue hover effect */
.service-card:hover {
    border: 2px solid #00A4E4;
    background: linear-gradient(135deg, 
        rgba(0, 164, 228, 0.15) 0%, 
        rgba(180, 220, 240, 0.5) 50%,
        rgba(0, 164, 228, 0.15) 100%
    );
    box-shadow: 
        0 8px 24px rgba(0, 164, 228, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 164, 228, 0.3);
}

/* 4. RIPPLE EFFECT ON ALL BUTTON CLICKS */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Make buttons relative for ripple positioning */
.control-btn,
.service-link,
.quick-action-btn,
.service-card {
    position: relative;
    overflow: hidden;
}

/* 5. CONFETTI ANIMATION ON 5-STAR RATINGS */

/* Screen flash effect for celebration */
.celebration-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4), transparent 70%);
    pointer-events: none;
    z-index: 9999;
    animation: celebrationFlash 0.6s ease-out forwards;
}

@keyframes celebrationFlash {
    0% {
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Enhanced confetti animation with rotation and drift */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) translateX(0) rotateZ(0deg) rotateY(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) translateX(var(--drift, 0)) rotateZ(var(--rotation, 720deg)) rotateY(360deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 12px;
    animation: confetti-fall 3s linear forwards;
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
    --drift: 0px;
    --rotation: 720deg;
}

/* ============================================
   END ADVANCED ANIMATIONS & EFFECTS
   ============================================ */

/* ============================================
   🔍 SMART SEARCH & FILTERING
   ============================================ */

/* Section Spacing */
.service-cards-container,
.search-all-services-container {
    margin-bottom: 2rem;
}

.search-all-services-container h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* Search and Filter Container */
.search-filter-container {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Search Bar */
.search-bar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.service-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 0.95rem;
    background: var(--light-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    outline: none;
}

.service-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 165, 0.1);
    background: white;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    width: 20px;
    height: 20px;
    color: #6c757d;
    pointer-events: none;
}

.clear-search-btn {
    position: absolute;
    right: 0.5rem;
    background: rgba(108, 117, 125, 0.1);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.clear-search-btn svg {
    width: 14px;
    height: 14px;
    color: #6c757d;
}

.clear-search-btn:hover {
    background: rgba(108, 117, 125, 0.2);
    transform: scale(1.1);
}

/* Search History Dropdown */
.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.clear-history-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.clear-history-btn:hover {
    background: rgba(0, 82, 165, 0.1);
}

.search-history-list {
    padding: 0.5rem 0;
}

.search-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.search-history-item:hover {
    background: rgba(0, 82, 165, 0.05);
}

.search-history-item-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.search-history-item-icon {
    width: 16px;
    height: 16px;
    color: #6c757d;
}

.search-history-item-remove {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s ease;
}

.search-history-item:hover .search-history-item-remove {
    opacity: 1;
}

.search-history-item-remove:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

/* Category Tabs */
.category-tabs-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.category-tabs-container::-webkit-scrollbar {
    height: 4px;
}

.category-tabs-container::-webkit-scrollbar-track {
    background: transparent;
}

.category-tabs-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--light-color);
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-tab:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.category-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-icon {
    font-size: 1rem;
    line-height: 1;
}

.tab-label {
    line-height: 1;
}

/* Search Results Info */
.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 164, 228, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.reset-filters-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.reset-filters-btn:hover {
    background: rgba(0, 82, 165, 0.1);
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-results-message svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.no-results-message h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.no-results-message p {
    font-size: 0.95rem;
}

/* Search Result Highlighting */
.search-highlight {
    background: rgba(255, 235, 59, 0.4);
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .service-search-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

[data-theme="dark"] .service-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

[data-theme="dark"] .search-history-dropdown {
    background: #2c2c2c;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .search-history-header {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .search-history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .category-tab {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

/* ===================================
   CURSOR-REACTIVE UI STYLES
   =================================== */

/* Avatar Eye Tracking Overlay */
.avatar-eye-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.avatar-eye {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-eye.left-eye {
    top: 35%;
    left: 35%;
}

.avatar-eye.right-eye {
    top: 35%;
    right: 35%;
}

.eye-pupil {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 30% 30%, #1a1a1a, #000);
    border-radius: 50%;
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Magnetic Cards */
.service-card.magnetic-active {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}

.service-card {
    transform-style: preserve-3d;
    will-change: transform;
}

/* Magnetic Buttons - Exclude toggles */
button:not(.dark-mode-toggle):not(.language-toggle), 
.btn:not(.dark-mode-toggle):not(.language-toggle) {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.2s ease;
    will-change: transform, filter;
}

/* Cursor Trail Canvas */
#cursor-trail {
    mix-blend-mode: screen;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .avatar-eye {
    background: rgba(45, 45, 45, 0.9);
}

[data-theme="dark"] .eye-pupil {
    background: radial-gradient(circle at 30% 30%, #fff, #e0e0e0);
}

/* Performance optimizations */
.magnetic-active,
button:hover,
.service-card:hover {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Smooth transitions when not actively interacting */
.service-card:not(:hover) {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.5s ease;
}

/* ===================================
   LIQUID MORPHING ANIMATIONS
   =================================== */

/* Avatar Liquid Border Pulse */
@keyframes liquidPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: blur(15px) hue-rotate(0deg);
    }
    33% {
        transform: scale(1.1) rotate(120deg);
        filter: blur(20px) hue-rotate(60deg);
    }
    66% {
        transform: scale(0.95) rotate(240deg);
        filter: blur(18px) hue-rotate(120deg);
    }
}

/* Avatar Breathing Animation */
@keyframes avatarBreathing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* Elastic Button Squish */
@keyframes elasticSquish {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.92, 0.95);
    }
    100% {
        transform: scale(0.95, 0.97);
    }
}

/* Elastic Button Bounce */
@keyframes elasticBounce {
    0% {
        transform: scale(0.95, 0.97);
    }
    30% {
        transform: scale(1.05, 1.02);
    }
    50% {
        transform: scale(0.98, 1.01);
    }
    70% {
        transform: scale(1.02, 0.99);
    }
    100% {
        transform: scale(1);
    }
}

/* Elastic Ripple Effect */
@keyframes elasticRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    50% {
        width: 200px;
        height: 200px;
        opacity: 0.5;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* Card Blob Morph Container */
.card-plasma-canvas {
    transition: opacity 0.4s ease;
    mix-blend-mode: screen;
    z-index: 10 !important;
}

/* Service cards need proper z-index context */
.service-card {
    z-index: 1;
    overflow: hidden !important; /* Contain plasma within card */
}

.service-card * {
    position: relative;
    z-index: 2;
}

/* Avatar Liquid Border */
.avatar-liquid-border {
    will-change: transform, filter;
}

/* Button Elastic Styles - Exclude toggles */
button:not(.dark-mode-toggle):not(.language-toggle), 
.btn:not(.dark-mode-toggle):not(.language-toggle) {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.elastic-ripple {
    position: absolute;
    pointer-events: none;
}

/* Ensure toggles stay stable */
.dark-mode-toggle,
.language-toggle {
    transform: none !important;
    animation: none !important;
    filter: none !important;
}

.dark-mode-toggle:hover,
.language-toggle:hover {
    transform: scale(1.05) !important;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .blob-path {
    stroke: rgba(138, 43, 226, 0.6);
}

[data-theme="dark"] .avatar-liquid-border {
    background: linear-gradient(45deg, 
        rgba(138, 43, 226, 0.4),
        rgba(0, 164, 228, 0.4),
        rgba(255, 0, 255, 0.4)
    );
}

/* ===================================
   CINEMATIC TRANSITIONS
   =================================== */

/* Scroll Reveal Animation */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Message Slide Animations */
@keyframes slideInRight {
    0% {
        transform: translateX(50px) scale(0.95);
        opacity: 0;
        filter: blur(5px);
    }
    60% {
        transform: translateX(-5px) scale(1.02);
        filter: blur(0);
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-50px) scale(0.95);
        opacity: 0;
        filter: blur(5px);
    }
    60% {
        transform: translateX(5px) scale(1.02);
        filter: blur(0);
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

/* Panel Transitions */
.panel, .control-panel {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.panel.hidden, .control-panel.hidden {
    transform: scale(0.95);
    opacity: 0;
    filter: blur(10px);
    pointer-events: none;
}

/* Loading Overlay Transitions */
#loading-overlay {
    transition: all 0.4s ease-out;
}

#loading-overlay.hidden {
    opacity: 0;
    -webkit-backdrop-filter: blur(0px) !important;
    backdrop-filter: blur(0px) !important;
    pointer-events: none;
}

/* Page Entrance */
#app-container {
    animation: pageEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pageEntrance {
    0% {
        opacity: 0;
        transform: scale(0.98);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* Service Cards Grid Entrance */
.service-card {
    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Staggered card animation delays */
.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.15s; }
.service-card:nth-child(3) { animation-delay: 0.2s; }
.service-card:nth-child(4) { animation-delay: 0.25s; }
.service-card:nth-child(5) { animation-delay: 0.3s; }
.service-card:nth-child(6) { animation-delay: 0.35s; }
.service-card:nth-child(7) { animation-delay: 0.4s; }
.service-card:nth-child(8) { animation-delay: 0.45s; }
.service-card:nth-child(9) { animation-delay: 0.5s; }
.service-card:nth-child(10) { animation-delay: 0.55s; }
.service-card:nth-child(11) { animation-delay: 0.6s; }
.service-card:nth-child(12) { animation-delay: 0.65s; }
.service-card:nth-child(13) { animation-delay: 0.7s; }
.service-card:nth-child(14) { animation-delay: 0.75s; }
.service-card:nth-child(15) { animation-delay: 0.8s; }
.service-card:nth-child(16) { animation-delay: 0.85s; }
.service-card:nth-child(17) { animation-delay: 0.9s; }

/* Message Transitions */
.message {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Transcript Auto-Scroll Smoothing */
#transcript {
    scroll-behavior: smooth;
}

/* Smooth state transitions */
.status-indicator {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode transitions */
body {
    transition: background 0.5s ease;
}

[data-theme="dark"] {
    transition: background 0.5s ease;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

[data-theme="dark"] .category-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .category-tab.active {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .search-results-info {
    background: rgba(0, 164, 228, 0.15);
}

[data-theme="dark"] .search-highlight {
    background: rgba(255, 235, 59, 0.3);
    color: #fff;
}

/* ============================================
   END SMART SEARCH & FILTERING
   ============================================ */


/* ============================================
   SCREEN EFFECTS & DISTORTIONS
   ============================================ */

/* Screen shake animation */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-2px, 2px); }
    20% { transform: translate(2px, -2px); }
    30% { transform: translate(-2px, -2px); }
    40% { transform: translate(2px, 2px); }
    50% { transform: translate(-2px, 2px); }
    60% { transform: translate(2px, -2px); }
    70% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
    90% { transform: translate(-2px, 2px); }
}

.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

/* Vignette pulse during AI thinking */
#app-container::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9998;
}

#app-container.thinking::after {
    opacity: 1;
    animation: vignettePulse 2s ease-in-out infinite;
}

@keyframes vignettePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* Flash effect */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    pointer-events: none;
    z-index: 9999;
    animation: flashEffect 0.3s ease-out forwards;
}

[data-theme="dark"] .screen-flash {
    background: rgba(255, 255, 255, 0.5);
}

@keyframes flashEffect {
    0% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* Chromatic aberration on hover */
.chromatic-hover {
    position: relative;
    transition: all 0.3s ease;
}

.chromatic-hover:hover {
    filter: blur(0.5px);
    text-shadow: 
        -2px 0 0 rgba(255, 0, 0, 0.5),
        2px 0 0 rgba(0, 255, 255, 0.5);
}

/* ============================================
   END SCREEN EFFECTS & DISTORTIONS
   ============================================ */

/* ============================================
   VOICE WAVEFORM VISUALIZATION
   ============================================ */

.waveform-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 80px;
    padding: 12px 24px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    box-shadow: var(--glass-shadow);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.waveform-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.waveform-bar {
    width: 4px;
    height: 20%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: height 0.1s ease;
    animation: waveformIdle 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(0, 164, 228, 0.5);
}

.waveform-bar:nth-child(1) { animation-delay: 0s; }
.waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; }
.waveform-bar:nth-child(6) { animation-delay: 0.5s; }
.waveform-bar:nth-child(7) { animation-delay: 0.6s; }
.waveform-bar:nth-child(8) { animation-delay: 0.7s; }
.waveform-bar:nth-child(9) { animation-delay: 0.8s; }
.waveform-bar:nth-child(10) { animation-delay: 0.9s; }

/* Active speaking animation */
.waveform-container.speaking .waveform-bar {
    animation: waveformActive 0.3s ease-in-out infinite;
}

@keyframes waveformIdle {
    0%, 100% {
        height: 20%;
        opacity: 0.6;
    }
    50% {
        height: 30%;
        opacity: 0.8;
    }
}

@keyframes waveformActive {
    0%, 100% {
        height: 30%;
        opacity: 1;
    }
    50% {
        height: 70%;
        opacity: 1;
        box-shadow: 0 0 20px rgba(0, 164, 228, 0.8);
    }
}

/* User speaking - green bars */
.waveform-container.user-speaking .waveform-bar {
    background: linear-gradient(180deg, #00d2d3, #1dd1a1);
    box-shadow: 0 0 10px rgba(29, 209, 161, 0.5);
    animation: waveformActive 0.2s ease-in-out infinite;
}

.waveform-container.user-speaking .waveform-bar:nth-child(even) {
    animation-delay: 0.1s;
}

/* AI speaking - blue/purple bars */
.waveform-container.ai-speaking .waveform-bar {
    background: linear-gradient(180deg, #667eea, #764ba2);
    box-shadow: 0 0 10px rgba(118, 75, 162, 0.5);
    animation: waveformActive 0.25s ease-in-out infinite;
}

.waveform-container.ai-speaking .waveform-bar:nth-child(odd) {
    animation-delay: 0.12s;
}

/* Dark mode adjustments */
[data-theme="dark"] .waveform-container {
    background: rgba(45, 45, 45, 0.9);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Hide waveform on mobile devices */
@media (max-width: 767px) {
    .waveform-container {
        display: none !important;
    }
}

/* ============================================
   END VOICE WAVEFORM VISUALIZATION
   ============================================ */

/* ============================================
   TYPING INDICATOR
   ============================================ */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin: 12px 0;
    background: rgba(0, 164, 228, 0.1);
    border-radius: 20px;
    border-left: 3px solid var(--primary-color);
    animation: fadeIn 0.3s ease-in-out;
}

[data-theme="dark"] .typing-indicator {
    background: rgba(0, 164, 228, 0.15);
    border-left-color: var(--primary-color);
}

.typing-indicator-text {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

[data-theme="dark"] .typing-indicator-text {
    color: #e0e0e0;
}

.typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: glow 1.5s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.typing-dot:nth-child(4) {
    animation-delay: 0.6s;
}

.typing-dot:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes glow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
        box-shadow: 0 0 0 rgba(0, 164, 228, 0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(0, 164, 228, 0.6);
    }
}

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

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

/* ============================================
   END TYPING INDICATOR
   ============================================ */

/* Service card Lottie player sizing */
.service-lottie {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto 8px auto;
}

.service-icon-svg {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto 8px auto;
}

.service-icon {
    font-size: 36px;
    line-height: 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
}


/* ============================================
   TEXT CHAT BUTTON
   ============================================ */

/* Info button style for text chat button */
.info-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.info-btn:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
}

/* ============================================
   END TEXT CHAT BUTTON
   ============================================ */

/* ============================================
   MULTI-TAB BROWSER OVERLAY (FULL PAGE)
   ============================================ */

.browser-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a1a;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    animation: browserFadeIn 0.25s ease-out;
}

/* Compact mode - only cover right panel when conversation is active */
.browser-overlay.compact-mode {
    position: fixed;
    top: var(--header-height);
    left: 35%;
    right: 0;
    bottom: 0;
    width: 65%;
    z-index: 100;
}

/* Responsive compact mode */
@media (max-width: 1200px) {
    .browser-overlay.compact-mode {
        left: 40%;
        width: 60%;
    }
}

@media (max-width: 768px) {
    .browser-overlay.compact-mode {
        left: 0;
        width: 100%;
    }
}

.browser-overlay.hidden {
    display: none;
}

/* Browser Header with Tabs */
.browser-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: stretch;
    height: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10001;
}

/* Tabs Container */
.browser-tabs {
    flex: 1;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    gap: 2px;
    padding-left: 8px;
}

.browser-tabs::-webkit-scrollbar {
    height: 4px;
}

.browser-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.browser-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.browser-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Individual Tab */
.browser-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    min-width: 180px;
    max-width: 240px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.browser-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

.browser-tab.active {
    background: #1a1a1a;
    color: white;
    border-bottom: 2px solid var(--secondary-color);
}

.browser-tab-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.browser-tab-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
}

.browser-tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.browser-tab-close {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.browser-tab-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
}

.browser-tab-close:hover {
    background: rgba(220, 53, 69, 0.8);
    color: white;
}

.browser-tab.loading .browser-tab-icon {
    animation: tabLoadingSpin 1s linear infinite;
}

@keyframes tabLoadingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Browser Controls */
.browser-controls {
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.browser-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 6px;
    color: #ff6b7a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.browser-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
}

.browser-btn:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(220, 53, 69, 1);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Browser Content Area */
.browser-content {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

.browser-iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.browser-iframe-container.active {
    display: flex;
}

/* Iframe Toolbar */
.browser-iframe-toolbar {
    background: #2c3e50;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Show toolbar in compact mode for "Open in Tab" button */
.browser-overlay.compact-mode .browser-iframe-toolbar {
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    background: rgba(44, 62, 80, 0.95);
    position: relative;
    z-index: 10;
}

.browser-iframe-url {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hide URL in compact mode, show only button */
.browser-overlay.compact-mode .browser-iframe-url {
    display: none;
}

.browser-open-full-tab {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    color: #2c3e50;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.browser-open-full-tab:hover {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.browser-open-full-tab svg {
    width: 16px;
    height: 16px;
    stroke: #3498db;
}

.browser-overlay.compact-mode .browser-open-full-tab {
    padding: 6px 14px;
    font-size: 11px;
}

.browser-overlay.compact-mode .browser-open-full-tab svg {
    width: 14px;
    height: 14px;
}

.browser-iframe-action {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 12px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.browser-iframe-action svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
}

.browser-iframe-action:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Iframe Loading Overlay */
.browser-iframe-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
}

.browser-iframe-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--secondary-color);
    margin: 0 auto 16px;
}

.browser-iframe-loading p {
    font-size: 16px;
    margin: 0;
}

/* Iframe Error Screen */
.browser-iframe-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: white;
    z-index: 20;
}

.browser-iframe-error .error-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.browser-iframe-error h3 {
    font-size: 24px;
    margin: 0 0 12px 0;
    color: white;
}

.browser-iframe-error p {
    font-size: 16px;
    margin: 0 0 32px 0;
    color: rgba(255, 255, 255, 0.7);
    max-width: 500px;
    line-height: 1.6;
}

.browser-iframe-action-large {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 164, 228, 0.3);
}

.browser-iframe-action-large svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
}

.browser-iframe-action-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 164, 228, 0.5);
}

/* The Actual Iframe */
.browser-iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Zoom iframe to 85% in compact mode */
.browser-overlay.compact-mode .browser-iframe {
    position: absolute;
    top: 0;
    left: 0;
    zoom: 0.85;
    -moz-transform: scale(0.85);
    -moz-transform-origin: 0 0;
    transform: scale(0.85);
    transform-origin: 0 0;
    width: 117.647%;
    height: 117.647%;
}

/* Animations */
@keyframes browserFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .browser-header {
        height: 45px;
    }
    
    .browser-tab {
        min-width: 140px;
        max-width: 180px;
        padding: 0 10px;
        font-size: 12px;
    }
    
    .browser-tab-icon {
        width: 14px;
        height: 14px;
    }
    
    .browser-btn span {
        display: none;
    }
    
    .browser-btn {
        padding: 8px;
    }
    
    .browser-iframe-toolbar {
        padding: 6px 12px;
    }
    
    .browser-iframe-url {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* ============================================
   END MULTI-TAB BROWSER OVERLAY
   ============================================ */

/* ============================================
   TEXT CHAT OVERLAY (IN AVATAR AREA)
   ============================================ */
.text-chat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #c8d0d9 0%, #a8b4c0 50%, #b8c4d0 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    z-index: 10;
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: morphingBackground 8s ease-in-out infinite;
}

@keyframes morphingBackground {
    0%, 100% {
        background: linear-gradient(135deg, #c8d0d9 0%, #a8b4c0 50%, #b8c4d0 100%);
    }
    33% {
        background: linear-gradient(135deg, #b8c4d0 0%, #98a8b8 50%, #aab8c8 100%);
    }
    66% {
        background: linear-gradient(135deg, #c0cbd8 0%, #a0b0be 50%, #b0bece 100%);
    }
}

.text-chat-overlay.hidden {
    display: none;
}

.text-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Chat Message Bubbles */
.chat-message {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-sm);
    animation: messageSlideIn 0.3s ease-out;
}

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

/* Agent messages - left side, dark blue bubble */
.chat-message.agent {
    justify-content: flex-start;
}

.chat-message.agent .message-bubble {
    background: rgba(0, 51, 102, 0.95);
    color: white;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* User messages - right side, light bubble */
.chat-message.user {
    justify-content: flex-end;
}

.chat-message.user .message-bubble {
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark-color);
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    font-size: var(--font-size-base);
    line-height: 1.5;
    word-wrap: break-word;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(0) translateZ(0);
}

.message-bubble:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
                0 8px 16px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.chat-message.agent .message-bubble:hover {
    background: linear-gradient(145deg, rgba(0, 51, 102, 1) 0%, rgba(0, 82, 165, 0.98) 100%);
    box-shadow: 0 20px 40px rgba(0, 102, 204, 0.5),
                0 8px 16px rgba(0, 51, 102, 0.4),
                inset 0 1px 0 rgba(100, 180, 255, 0.4);
}

.chat-message.user .message-bubble:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(248, 252, 255, 1) 100%);
    box-shadow: 0 20px 40px rgba(0, 164, 228, 0.3),
                0 8px 16px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

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

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

.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin: 12px 0 8px 0;
    font-weight: 700;
    line-height: 1.3;
}

.message-bubble h1 {
    font-size: 1.25em;
}

.message-bubble h2 {
    font-size: 1.15em;
}

.message-bubble h3 {
    font-size: 1.05em;
}

.message-bubble h1:first-child,
.message-bubble h2:first-child,
.message-bubble h3:first-child {
    margin-top: 0;
}

.message-bubble a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.9;
}

.message-bubble a:hover {
    opacity: 1;
    text-decoration: none;
}

.chat-message.agent .message-bubble a {
    color: rgba(255, 255, 255, 0.95);
}

.chat-message.user .message-bubble a {
    color: var(--primary-color);
}

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

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

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(0, 51, 102, 0.95);
    border-radius: 18px 18px 18px 4px;
    max-width: 60px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input area at bottom */
.text-chat-input-wrapper {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    align-items: flex-end;
}

.text-voice-btn {
    padding: 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.text-voice-btn:hover {
    background: var(--primary-color);
}

.text-voice-btn:active {
}

.text-voice-btn.listening {
    background: var(--danger-color);
    animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

.text-voice-btn svg {
    width: 20px;
    height: 20px;
}

.text-upload-btn {
    padding: 12px;
    background: #4facfe;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.text-upload-btn:hover {
    background: #00f2fe;
}

.text-upload-btn:active {
}

.text-upload-btn.uploading {
    opacity: 0.6;
    animation: uploadPulse 1s ease-in-out infinite;
}

@keyframes uploadPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.text-upload-btn svg {
    width: 20px;
    height: 20px;
}

#text-file-input {
    display: none;
}

.file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(79, 172, 254, 0.1);
    border-radius: 12px;
    margin: 8px 0;
    font-size: 0.9em;
    border: 1px solid rgba(79, 172, 254, 0.3);
}

.file-attachment svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.file-attachment .file-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-attachment .remove-file {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 2px;
    margin-left: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.file-attachment .remove-file:hover {
    opacity: 1;
}

.text-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(0, 82, 165, 0.2);
    border-radius: 20px;
    font-family: inherit;
    font-size: var(--font-size-base);
    resize: none;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
    transition: all 0.3s ease;
    background: white;
    color: var(--dark-color);
}

.text-chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 165, 0.1);
}

.text-chat-input::placeholder {
    color: #999;
}

.text-send-btn {
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.text-send-btn:hover {
    background: var(--secondary-color);
}

.text-send-btn:active {
}

.text-send-btn svg {
    width: 20px;
    height: 20px;
}

.text-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced Service Card Contrast for Text Chat */
body:has(.text-chat-overlay:not(.hidden)) .service-card {
    background: white !important;
    border: 2px solid rgba(0, 82, 165, 0.3) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

body:has(.text-chat-overlay:not(.hidden)) .service-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 6px 20px rgba(0, 82, 165, 0.35) !important;
    background: rgba(0, 164, 228, 0.08) !important;
}

/* Compact cards styling */
.compact-card {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid rgba(0, 82, 165, 0.25);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.compact-card:hover {
    transform: translateX(4px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 82, 165, 0.25);
    background: rgba(0, 164, 228, 0.05);
}

.compact-card .card-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.compact-card .card-title {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

/* Service cards within message bubbles */
.message-service-cards {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-service-cards .compact-card {
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.95);
}

.chat-message.agent .message-service-cards .compact-card {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 164, 228, 0.4);
}

.chat-message.agent .message-service-cards .compact-card:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--secondary-color);
}

/* Dark mode adjustments */
[data-theme="dark"] .text-chat-overlay {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.98) 0%, rgba(0, 82, 165, 0.98) 100%);
}

[data-theme="dark"] .text-chat-input-wrapper {
    background: rgba(30, 30, 30, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .text-chat-input {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Human Handoff Offer */
.human-handoff-offer {
    margin: var(--spacing-md) 0;
    animation: messageSlideIn 0.3s ease-out;
}

.handoff-message {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ff9f00;
    border-radius: 16px;
    padding: var(--spacing-md);
    box-shadow: 0 4px 12px rgba(255, 159, 0, 0.2);
}

.handoff-message p {
    margin: 0 0 var(--spacing-sm) 0;
    color: #856404;
    font-weight: 500;
}

.handoff-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.handoff-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 140px;
}

.handoff-btn.primary {
    background: var(--primary-color);
    color: white;
}

.handoff-btn.primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 165, 0.3);
}

.handoff-btn.secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.handoff-btn.secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Proactive Suggestions */
.suggestions-container {
    margin: var(--spacing-md) 0;
    animation: messageSlideIn 0.3s ease-out;
}

.suggestions-header {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.suggestions-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.suggestion-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(4px);
}

[data-theme="dark"] .text-chat-input::placeholder {
    color: #666;
}

[data-theme="dark"] .message-bubble.user {
    background: rgba(50, 50, 50, 0.95);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
        font-size: var(--font-size-sm);
    }
    
    .text-chat-input-wrapper {
        padding: var(--spacing-sm);
    }
    
    .text-chat-messages {
        padding: var(--spacing-md);
    }
}

/* ============================================
   END TEXT CHAT OVERLAY
   ============================================ */

/* ============================================
   LIVE SERVICE CARDS - Real-time ANAM Integration
   ============================================ */

.live-service-cards-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    width: 100%;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.live-service-cards-container.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.live-service-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 248, 255, 0.95));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    opacity: 0;
    animation: cardSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.live-service-card:hover {
    transform: translateX(-4px);
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.2),
        0 0 0 2px rgba(59, 130, 246, 0.5) inset;
}

/* Predicted cards - subtle styling */
.live-service-card.predicted {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(240, 248, 255, 0.85));
    border-color: rgba(59, 130, 246, 0.2);
    border-style: dashed;
}

.live-service-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.live-service-card .card-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: -0.02em;
}

.live-service-card .predicted-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(59, 130, 246, 0.7);
    background: rgba(59, 130, 246, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px dashed rgba(59, 130, 246, 0.3);
}

.live-service-card .card-body {
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

.live-service-card .card-body p {
    margin: 0 0 12px 0;
}

.live-service-card .card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.live-service-card .card-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #1e40af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.live-service-card .card-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Highlight pulse animation - activated when ANAM mentions service */
.live-service-card.highlight-pulse {
    animation: highlightPulse 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card slide-in animation */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Highlight pulse - smooth glow effect */
@keyframes highlightPulse {
    0% {
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(255, 255, 255, 0.5) inset;
        border-color: rgba(59, 130, 246, 0.3);
    }
    25% {
        box-shadow:
            0 15px 60px rgba(59, 130, 246, 0.4),
            0 0 0 3px rgba(59, 130, 246, 0.8) inset,
            0 0 40px rgba(59, 130, 246, 0.6);
        border-color: rgba(59, 130, 246, 0.8);
    }
    50% {
        box-shadow:
            0 20px 80px rgba(59, 130, 246, 0.5),
            0 0 0 4px rgba(59, 130, 246, 1) inset,
            0 0 60px rgba(59, 130, 246, 0.8);
        border-color: rgba(59, 130, 246, 1);
    }
    75% {
        box-shadow:
            0 15px 60px rgba(59, 130, 246, 0.4),
            0 0 0 3px rgba(59, 130, 246, 0.8) inset,
            0 0 40px rgba(59, 130, 246, 0.6);
        border-color: rgba(59, 130, 246, 0.8);
    }
    100% {
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(255, 255, 255, 0.5) inset;
        border-color: rgba(59, 130, 246, 0.3);
    }
}

/* Dark theme support */
[data-theme="dark"] .live-service-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(59, 130, 246, 0.3) inset;
}

[data-theme="dark"] .live-service-card .card-header h5 {
    color: #60a5fa;
}

[data-theme="dark"] .live-service-card .card-body {
    color: #cbd5e1;
}

[data-theme="dark"] .live-service-card .card-link {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

[data-theme="dark"] .live-service-card .card-link:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .live-service-cards-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .live-service-card {
        padding: 12px;
    }

    .live-service-card .card-header h5 {
        font-size: 16px;
    }
}

/* ============================================
   END LIVE SERVICE CARDS
   ============================================ */


/* ============================================
   END TRANSCRIPT STYLES
   ============================================ */

