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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f7f7f8;
    color: #000000;
    height: 100vh;
    overflow: hidden;
}

.chat-wrapper {
    width: 100%;
    height: 100vh;
    background: #f7f7f8;
    display: flex;
    flex-direction: column;
    position: relative;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   APP HEADER
   ============================================ */

.app-header {
    background: #ffffff;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e5e5;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: stretch;
    position: relative;
    gap: 0;
    overflow: hidden;
}

.app-title {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 50%, #232D5F 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    color: transparent;
    margin: 0;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.20);
    grid-column: 2;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
    justify-self: center;
}

.app-title:hover {
    opacity: 0.8;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    grid-column: 3;
    justify-self: end;
}

.sidebar-header {
    grid-column: 1;
    padding: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    gap: 12px;
    width: 300px;
    height: calc(100% + 40px);
    margin: -20px -30px -20px -30px;
    padding: 20px 16px 20px 30px;
    box-shadow: none;
    box-sizing: border-box;
    align-self: stretch;
    transition: width 0.2s ease, padding 0.2s ease;
}

.sidebar-header.minimized {
    width: auto;
    padding: 20px 16px;
    justify-content: center;
    background: transparent;
}

.sidebar-header.minimized .sidebar-title,
.sidebar-header.minimized .new-chat-btn {
    display: none;
}

.sidebar-header.minimized .sidebar-header-buttons {
    gap: 0;
}

.sidebar-header.minimized .minimize-sidebar-btn {
    background: transparent;
    border: none;
    border-radius: 0;
    color: #232D5F;
}

.sidebar-header.minimized .minimize-sidebar-btn:hover {
    background: transparent;
    border: none;
    border-radius: 0;
    color: #232D5F;
}


/* ============================================
   CONNECTION INDICATOR
   ============================================ */

.connection-indicator {
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.connection-indicator:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
}

.connection-indicator.connected .status-dot {
    background: #10b981;
}

/* ============================================
   LOGOUT BUTTON
   ============================================ */

.logout-button {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 50;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}

.logout-button:hover {
    background: linear-gradient(135deg, #1a2347 0%, #232D5F 100%);
    transform: translateY(-1px);
}

.logout-button:active {
    transform: translateY(0);
    opacity: 0.7;
}

.logout-icon {
    font-size: 14px;
}

.logout-text {
    font-size: 15px;
    font-weight: 600;
}

/* Hide logout text on small screens */
@media (max-width: 768px) {
    .logout-button {
        padding: 12px 24px;
    }
    
    .logout-text {
        display: none;
    }
    
    .header-actions {
        gap: 8px;
    }
}


/* ============================================
   CHAT SIDEBAR
   ============================================ */

.chat-sidebar {
    width: 300px;
    background: #ffffff;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, width 0.2s ease, min-width 0.2s ease;
    z-index: 100;
    overflow: hidden;
    min-width: 300px;
}

.chat-sidebar.hidden {
    transform: translateX(-100%);
    min-width: 0;
}

/* Desktop: allow sidebar to be hidden */
@media only screen and (min-width: 769px) {
    .chat-sidebar.hidden {
        transform: none;
        width: 0 !important;
        min-width: 0 !important;
        border-right: none;
        padding: 0;
    }
    
    .sidebar-header.minimized {
        width: auto;
        min-width: auto;
        margin: -20px 0 -20px -30px;
        padding: 20px 16px;
    }
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
}

.sidebar-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-chat-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 300;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.minimize-sidebar-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 300;
    transition: all 0.2s;
}

.minimize-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar-content.hidden {
    display: none;
    visibility: hidden;
    opacity: 0;
}

.history-item {
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f0f0 100%);
    border: 1px solid transparent;
    position: relative;
    z-index: 0;
}

.history-item:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #e0e0e0 100%);
    border-color: #232D5F;
    transform: translateX(4px);
    z-index: 5;
}

.history-item.active {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    border-color: #232D5F;
    color: #ffffff;
    z-index: 2;
}

.history-item.active:hover {
    background: linear-gradient(135deg, #2a3a6f 0%, #212a4f 100%);
    z-index: 6;
}

.history-item.active .history-preview {
    color: #ffffff;
}

.history-item.active .history-preview > div {
    color: #ffffff;
}

.history-item.active .history-delete {
    background: rgba(255, 68, 68, 0.2);
    color: #ff6666;
    display: flex !important;
    opacity: 0.6;
    pointer-events: auto !important;
    z-index: 10 !important;
}

.history-item.active:hover .history-delete {
    display: flex;
    background: rgba(255, 68, 68, 0.3);
    color: #ff8888;
    opacity: 0.8;
}

.history-item.active .history-delete:hover {
    background: #ff4444;
    color: #ffffff;
    opacity: 1;
}

.history-preview {
    font-size: 13px;
    font-weight: 500;
    color: #232D5F;
    margin-bottom: 4px;
    line-height: 1.5;
    word-wrap: break-word;
}

.history-preview > div:first-child {
    /* Agent name - bold, slightly smaller */
    margin-bottom: 3px;
}

.history-preview > div:last-child {
    /* Message preview - can be truncated */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-time {
    font-size: 11px;
    color: #666666;
    opacity: 0.8;
}

.history-item.active .history-time {
    color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

.history-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 68, 68, 0.1);
    border: none;
    color: #ff4444;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    z-index: 10;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

.history-item:hover .history-delete {
    display: flex;
    z-index: 10;
    pointer-events: auto;
}

.history-delete:active,
.history-delete:focus {
    outline: none;
    pointer-events: auto;
    z-index: 10;
}

.history-delete:hover {
    background: #ff4444;
    color: #ffffff;
    transform: scale(1.1);
}

/* ============================================
   CHAT CONTAINER
   ============================================ */

.chat-container {
    flex: 1;
    background: #f7f7f8;
    overflow-y: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 60%;
    max-width: 60%;
    margin: 0 auto;
    /* Hide scrollbar but keep scrolling functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Medium screens (769px - 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .chat-container {
        width: 70%;
        max-width: 70%;
        padding: 35px 24px;
    }
    
    .agent-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .message {
        max-width: 75%;
    }
}

.chat-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.welcome-message {
    text-align: center;
    padding: 40px 20px 20px;
    flex: 0 0 auto;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.welcome-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 50%, #232D5F 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    color: transparent; /* Fallback for browsers that don't support background-clip */
}

.welcome-subtitle {
    font-size: 15px;
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 50%, #232D5F 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    color: transparent; /* Fallback for browsers that don't support background-clip */
}

/* ============================================
   MESSAGES
   ============================================ */

.message {
    display: flex;
    gap: 0;
    max-width: 70%;
    animation: slideIn 0.3s ease;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.agent {
    align-self: flex-start;
}

.message-icon {
    display: none;
}

.message-content {
    background: transparent;
    padding: 14px 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
}

.message.user .message-content {
    background: linear-gradient(135deg, #e5e5ea 0%, #d5d5da 100%);
    border-radius: 18px;
    padding: 14px 18px;
    color: #000000;
}

.message-text {
    line-height: 1.6;
    font-size: 15px;
    word-wrap: break-word;
    color: inherit;
}

.message-time {
    font-size: 11px;
    opacity: 0.5;
    margin-top: 6px;
    color: #666;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 10px 0;
    align-items: center;
}

.message-content.typing-indicator-wrapper {
    background: transparent;
    border: none;
    min-width: 50px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    animation: typing 1.4s infinite;
}

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

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

/* ============================================
   INPUT AREA
   ============================================ */

.input-area {
    background: #ffffff;
    padding: 20px;
    border-top: 1px solid #e5e5e5;
}

/* Input group in input-area - keep same size as in chat container */
.input-area .input-group {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 0 0 auto;
    padding: 0;
    background: transparent;
}

.input-area .input-group input[type="text"] {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
}

.control-btn {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.control-btn.stop.visible {
    display: inline-flex;
}

.control-btn.stop:hover {
    background: linear-gradient(135deg, #ff4444 0%, #ff6666 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.input-area-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.attach-btn,
.mic-btn {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border: 1px solid #e5e5e5;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.attach-btn:hover,
.mic-btn:hover {
    background: linear-gradient(135deg, #f5f5f5 0%, #e5e5e5 100%);
    border-color: #232D5F;
    color: #232D5F;
}

.attach-btn:disabled,
.mic-btn:disabled {
    background: #f5f5f5;
    border-color: #e5e5e5;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.attach-btn.has-image {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    border-color: #232D5F;
    color: #ffffff;
}

.mic-btn.recording {
    background: linear-gradient(135deg, #ff4444 0%, #ff6666 100%);
    color: #ffffff;
    border-color: #ff4444;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
}

.mic-btn.processing {
    background: linear-gradient(135deg, #ffa500 0%, #ffb833 100%);
    color: #ffffff;
    border-color: #ffa500;
    animation: spin 1s linear infinite;
}

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

input[type="text"] {
    flex: 1;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    font-size: 15px;
    color: #000000;
    outline: none;
    transition: all 0.2s;
}

input[type="text"]:focus {
    border-color: #232D5F;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
}

input[type="text"]::placeholder {
    color: #999;
}

input[type="text"]:disabled {
    background: #f0f0f0;
    border-color: #e5e5e5;
    color: #ccc;
    cursor: not-allowed;
}

input[type="text"]:disabled::placeholder {
    color: #ccc;
}

.send-btn {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: linear-gradient(135deg, #1a2347 0%, #232D5F 100%);
    transform: translateY(-1px);
}

.send-btn:disabled {
    background: #e5e5e5;
    color: #aaa;
    cursor: not-allowed;
    transform: none;
}

/* Image Preview */
.image-preview-inline {
    display: none;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 10px;
    align-items: center;
    gap: 10px;
    border: 1px solid #e5e5e5;
}

.image-preview-inline.visible {
    display: flex;
}

/* Image Gallery Container */
.image-gallery-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 500px;
}

.image-gallery {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 450px;
    height: 60px;
    border-radius: 8px;
    position: relative;
    gap: 8px;
    padding: 5px;
    scrollbar-width: none; /* Hide scrollbar */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
    align-items: center;
}

.image-gallery::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.image-gallery img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #ddd;
    flex-shrink: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0.8;
}

.image-gallery img:hover {
    transform: scale(1.15);
    opacity: 1;
    border-color: #232D5F;
    box-shadow: 0 4px 12px rgba(35, 45, 95, 0.3);
}

.image-gallery img.active {
    border: 3px solid #232D5F;
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 6px 16px rgba(35, 45, 95, 0.4);
    z-index: 10;
    position: relative;
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: scaleIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Modal Navigation Buttons */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.modal-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav:disabled {
    background: rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
    transform: translateY(-50%);
}

.modal-nav:disabled:hover {
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Navigation Arrows */
.nav-arrow {
    background: #232D5F;
    color: #ffffff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.8;
}

.nav-arrow:hover {
    background: #1a2347;
    opacity: 1;
    transform: scale(1.1);
}

.nav-arrow:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.nav-prev {
    margin-right: 4px;
}

.nav-next {
    margin-left: 4px;
}

/* Gallery Info */
.gallery-info {
    flex: 1;
    font-size: 13px;
    color: #232D5F;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.image-counter {
    font-weight: 600;
    font-size: 12px;
    color: #666;
}

.image-filename {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.image-preview-inline .remove {
    background: #ff4444;
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.image-preview-inline .remove:hover {
    background: #cc0000;
}

/* ============================================
   BOTTOM ACTION BAR
   ============================================ */

/* .bottom-actions removed - now part of .input-area-bottom */

/* ============================================
   IMPRESSIVE AGENT SELECTOR
   ============================================ */

.agent-menu {
    position: relative;
}

.agent-toggle {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 50%, #232D5F 100%);
    background-size: 200% 100%;
    color: #ffffff;
    border: none;
    padding: 16px 28px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(35, 45, 95, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 56px;
    animation: shimmer 3s ease-in-out infinite;
}

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

.agent-toggle:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(35, 45, 95, 0.5),
                0 0 60px rgba(35, 45, 95, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    background-position: 100% 50%;
}

.agent-toggle:active {
    transform: translateY(-2px) scale(1);
}

.agent-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

.agent-label {
    font-size: 15px;
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.agent-arrow {
    font-size: 12px;
    opacity: 0.7;
    transition: all 0.3s;
}

.agent-menu.open .agent-arrow {
    transform: rotate(180deg);
}

.agent-dropdown {
    position: absolute;
    bottom: 70px;
    left: 0;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border: 2px solid rgba(35, 45, 95, 0.1);
    border-radius: 24px;
    padding: 16px;
    min-width: 340px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

.agent-menu.open .agent-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Agent Cards Grid */
.agent-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 900px;
    margin: 0px auto 0;
    padding: 0 20px;
}

.agent-cards-grid > .agents-title {
    grid-column: 1 / -1;
}

.agent-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.agent-card:hover {
    border-color: #232D5F;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    box-shadow: 0 8px 24px rgba(35, 45, 95, 0.15);
    transform: translateY(-2px);
}

.agent-card.selected {
    border-color: #232D5F;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 50%, #ffffff 100%);
    box-shadow: 0 4px 16px rgba(35, 45, 95, 0.2);
}

.agent-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e5e5e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.agent-card:hover .agent-card-icon {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    transform: scale(1.05);
}

.agent-card.selected .agent-card-icon {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
}

.agent-card-content {
    flex: 1;
    min-width: 0;
}

.agent-card-title {
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #232D5F;
    margin-bottom: 0px;
    line-height: 1.3;
}

.agent-card-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Suggested Questions Container */
.suggested-questions-container {
    width: 100%;
    max-width: 900px;
    margin: 16px auto 0;
    padding: 0 20px;
    animation: fadeInUp 0.4s ease-out;
}

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

.suggested-questions-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agents-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-top: 24px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggested-questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggested-question-item {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    color: #232D5F;
    text-align: left;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}


.suggested-question-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-color: #232D5F;
    box-shadow: 0 4px 12px rgba(35, 45, 95, 0.15);
    transform: translateX(4px);
}

.suggested-question-item:active {
    transform: translateX(2px) scale(0.98);
}

/* Agent menu and input group inside chat container */
.chat-container .agent-menu {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    margin-top: 20px;
}

.chat-container .agent-toggle {
    width: 100%;
    justify-content: center;
}

.chat-container .agent-dropdown {
    bottom: auto;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.95);
    right: auto;
}

.chat-container .agent-menu.open .agent-dropdown {
    transform: translateX(-50%) translateY(0) scale(1);
}

.chat-container .input-group {
    width: 100%;
    max-width: 900px;
    margin: 20px auto 0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 0 0 auto;
    padding: 0;
    background: transparent;
}

.chat-container .input-group input[type="text"] {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.chat-container .clear-chat-btn-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Ensure elements are visible in chat container */
.chat-container .agent-menu {
    visibility: visible;
    opacity: 1;
    display: block;
}

.chat-container .input-group {
    visibility: visible;
    opacity: 1;
    display: flex;
}

.dropdown-header {
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #232D5F;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding: 0 12px;
    opacity: 0.7;
}

.agent-option {
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border: 2px solid transparent;
    color: #232D5F;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.agent-option:last-child {
    margin-bottom: 0;
}

.agent-option:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-color: rgba(35, 45, 95, 0.2);
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 4px 16px rgba(35, 45, 95, 0.12);
}

.agent-option.active {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    border-color: #232D5F;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(35, 45, 95, 0.3);
}

.agent-option.active:hover {
    transform: translateX(4px) scale(1.02);
}

.agent-option.active .option-desc {
    color: rgba(255, 255, 255, 0.8);
}

.option-icon {
    font-size: 28px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-text {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.option-desc {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
}

/* ============================================
   CLEAR CHAT BUTTON (Bottom)
   ============================================ */

.clear-chat-btn-bottom {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border: 2px solid #e5e5e5;
    color: #666;
    padding: 12px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.clear-chat-btn-bottom:hover {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-color: #ff4444;
    color: #ff4444;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(255, 68, 68, 0.25);
}

.clear-icon {
    font-size: 18px;
}

.clear-label {
    font-size: 14px;
    font-weight: 700;
}

/* ============================================
   TEXT-TO-SPEECH BUTTON
   ============================================ */

.tts-btn {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    box-shadow: 0 2px 4px rgba(35, 45, 95, 0.3);
    overflow: hidden;
    line-height: 1;
}

.tts-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    margin-left: 2px;
}

.tts-btn:hover {
    background: linear-gradient(135deg, #1a2347 0%, #232D5F 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(35, 45, 95, 0.4);
}

.message.user .tts-btn {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    color: #ffffff;
}

.message.user .tts-btn:hover {
    background: linear-gradient(135deg, #1a2347 0%, #232D5F 100%);
    transform: scale(1.1);
}

.tts-btn.speaking {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #ffffff;
    animation: pulse-speaking 1s ease-in-out infinite;
}

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

/* ============================================
   MARKDOWN STYLES
   ============================================ */

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 16px 0 8px 0;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}

.message-content h1 { font-size: 24px; }
.message-content h2 { font-size: 20px; }
.message-content h3 { font-size: 18px; }
.message-content h4 { font-size: 16px; }
.message-content h5 { font-size: 14px; }
.message-content h6 { font-size: 13px; }

.message-content p {
    margin: 8px 0;
    line-height: 1.7;
}

.message-content ul,
.message-content ol {
    margin: 10px 0;
    padding-left: 24px;
}

.message-content li {
    margin: 4px 0;
    line-height: 1.6;
}

.message-content blockquote {
    border-left: 3px solid #232D5F;
    padding-left: 16px;
    margin: 12px 0;
    color: #666;
    font-style: italic;
}

.message.user .message-content blockquote {
    border-left-color: #999;
}

.message-content code {
    background: linear-gradient(135deg, #f5f5f5 0%, #e5e5e5 100%);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #232D5F;
}

.message.user .message-content code {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

.message-content pre {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    color: #ffffff;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 13px;
    line-height: 1.5;
}

.message-content a {
    background: linear-gradient(135deg, #232D5F 0%, #1a2347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #232D5F;
    text-decoration: underline;
    transition: all 0.2s;
}

.message.user .message-content a {
    color: #000;
}

.message-content a:hover {
    opacity: 0.7;
}

.message-content hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 16px 0;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.message-content table th,
.message-content table td {
    border: 1px solid #e5e5e5;
    padding: 8px 12px;
    text-align: left;
}

.message-content table th {
    background: #f5f5f5;
    font-weight: 600;
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    display: block;
    cursor: pointer;
}

/* Response Images Container */
.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    justify-content: flex-start;
}

.message-images img {
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    margin: 0;
}

.message-images img:hover {
    transform: scale(1.05);
    border-color: #232D5F;
    box-shadow: 0 4px 12px rgba(35, 45, 95, 0.3);
}

.message-content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    display: block;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

/* ============================================
   VIDEO THUMBNAILS (Response Videos)
   ============================================ */

/* Media Titles */
.media-title {
    font-size: 14px;
    font-weight: 600;
    color: #232D5F;
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 2px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Video Thumbnails - Match Image Gallery Style */
.message-videos {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
    justify-content: flex-start;
    padding: 0 8px; /* Add padding to prevent border clipping on hover */
}

.message-videos .video-thumbnail {
    margin: 0;
}

/* Image Gallery - Match Video Structure */
.message-images {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
    justify-content: flex-start;
}

.message-images img {
    margin: 0;
}

/* Media Items Container - Horizontal Layout */
.media-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;
    padding: 5px 8px; /* Add padding on sides to prevent border clipping */
}

.media-items img,
.media-items .video-thumbnail {
    flex-shrink: 0;
}

.message-videos video,
.message-videos iframe {
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    margin: 0;
    flex-shrink: 0;
    opacity: 0.8;
}

.message-videos video:hover,
.message-videos iframe:hover {
    transform: scale(1.08);
    border-color: #232D5F;
    box-shadow: 0 4px 12px rgba(35, 45, 95, 0.3);
    opacity: 1;
}

/* Video thumbnail wrapper with play button overlay */
.video-thumbnail {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 320px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #ddd;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.video-thumbnail:hover {
    transform: scale(1.04);
    border-color: #232D5F;
    box-shadow: 0 6px 20px rgba(35, 45, 95, 0.4);
    z-index: 10; /* Ensure it appears above other elements */
}

.video-thumbnail video,
.video-thumbnail iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    border-radius: 0;
    margin: 0;
    transition: none;
}

/* ============================================
   SCROLLBAR
   ============================================ */

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

/* ============================================
   TABLET AND BELOW (max-width: 768px)
   ============================================ */
@media only screen and (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: 280px;
        min-width: 280px;
        z-index: 999;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    }

    .chat-sidebar.hidden {
        transform: translateX(-100%);
    }

    .chat-container {
        width: 100%;
        max-width: 100%;
        padding: 20px 16px;
        gap: 20px;
    }

    .app-header {
        padding: 14px 16px;
        gap: 0;
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .sidebar-header {
        gap: 8px;
        padding: 0;
        margin: -14px -16px -14px -16px;
        padding: 14px 12px 14px 16px;
        height: calc(100% + 28px);
        width: 280px;
        box-sizing: border-box;
        align-self: stretch;
    }
    
    .sidebar-header.minimized {
        width: auto;
        padding: 14px 12px;
        margin: -14px 0 -14px -16px;
    }
    
    .sidebar-title {
        font-size: 14px;
    }
    
    .new-chat-btn,
    .minimize-sidebar-btn {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .minimize-sidebar-btn {
        font-size: 16px;
    }
    
    .welcome-message {
        padding: 30px 10px 20px;
    }
    
    .welcome-icon {
        font-size: 48px;
        margin-bottom: 12px;
    }
    
    .welcome-title {
        font-size: 20px;
    }
    
    .welcome-subtitle {
        font-size: 14px;
    }
    
    .input-area-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .agent-toggle {
        padding: 14px 24px;
        min-height: 52px;
        font-size: 14px;
        justify-content: center;
    }
    
    .agent-icon {
        font-size: 22px;
    }
    
    .agent-label {
        font-size: 14px;
    }
    
    .agent-dropdown {
        min-width: 100%;
        left: 0;
        right: 0;
        bottom: 60px;
    }
    
    .agent-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 10px;
    }
    
    .agent-card {
        padding: 18px;
    }
    
    .agent-card-icon {
        width: 48px;
        height: 48px;
        font-size: 26px;
    }
    
    .agent-card-title {
        font-size: 15px;
    }
    
    .agent-card-desc {
        font-size: 12px;
    }
    
    .clear-chat-btn-bottom {
        padding: 12px 18px;
        justify-content: center;
        font-size: 14px;
    }
    
    .input-group {
        width: 100%;
        gap: 8px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-content {
        font-size: 15px;
        padding: 12px 16px;
    }
    
    .message.user .message-content {
        padding: 12px 16px;
    }
    
    .input-area {
        padding: 16px;
    }
    
    .controls {
        margin-bottom: 10px;
    }
    
    .attach-btn,
    .mic-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        min-width: 44px;
    }
    
    input[type="text"] {
        padding: 12px 16px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .send-btn {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 80px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .logout-button {
        padding: 10px 16px;
    }
    
    .connection-indicator {
        width: 32px;
        height: 32px;
    }
    
    .image-preview-inline {
        padding: 12px;
        flex-wrap: wrap;
    }
    
    .image-gallery-container {
        max-width: 100%;
    }
    
    .image-gallery {
        max-width: 100%;
    }
    
    .suggested-questions-container {
        padding: 0 16px;
    }
    
    .suggested-question-item {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* ============================================
   MOBILE PHONES (max-width: 480px)
   ============================================ */
@media only screen and (max-width: 480px) {
    .app-header {
        padding: 12px 14px;
        gap: 6px;
    }
    
    .app-title {
        font-size: 16px;
        letter-spacing: -0.2px;
    }
    
    .sidebar-header {
        padding: 0;
        gap: 6px;
        margin: -12px -14px -12px -14px;
        padding: 12px 10px 12px 14px;
        height: calc(100% + 24px);
        width: 260px;
        box-sizing: border-box;
        align-self: stretch;
    }
    
    .sidebar-header.minimized {
        width: auto;
        padding: 12px 10px;
        margin: -12px 0 -12px -14px;
    }
    
    .sidebar-title {
        font-size: 12px;
    }
    
    .new-chat-btn,
    .minimize-sidebar-btn {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .minimize-sidebar-btn {
        font-size: 14px;
    }
    
    .chat-sidebar {
        width: 260px;
        min-width: 260px;
    }
    
    .chat-container {
        padding: 16px 12px;
        gap: 16px;
    }
    
    .welcome-message {
        padding: 24px 8px 16px;
    }
    
    .welcome-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }
    
    .welcome-title {
        font-size: 18px;
    }
    
    .welcome-subtitle {
        font-size: 13px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-content {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .message.user .message-content {
        padding: 10px 14px;
    }
    
    .agent-toggle {
        padding: 12px 18px;
        min-height: 48px;
        font-size: 13px;
    }
    
    .agent-icon {
        font-size: 20px;
    }
    
    .agent-label {
        font-size: 13px;
    }
    
    .agent-dropdown {
        min-width: calc(100vw - 32px);
        left: 0;
        right: 0;
        bottom: 56px;
        padding: 12px;
    }
    
    .agent-cards-grid {
        gap: 12px;
        padding: 0 8px;
    }
    
    .agent-card {
        padding: 16px;
    }
    
    .agent-card-icon {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    .agent-card-title {
        font-size: 14px;
    }
    
    .agent-card-desc {
        font-size: 11px;
    }
    
    .input-area {
        padding: 12px;
    }
    
    .input-group {
        gap: 6px;
    }
    
    .attach-btn,
    .mic-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        min-width: 40px;
    }
    
    input[type="text"] {
        padding: 10px 14px;
        font-size: 16px;
    }
    
    .send-btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .clear-chat-btn-bottom {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .logout-button {
        padding: 8px 12px;
    }
    
    .logout-text {
        display: none;
    }
    
    .connection-indicator {
        width: 28px;
        height: 28px;
    }
    
    .suggested-questions-container {
        padding: 0 12px;
    }
    
    .suggested-question-item {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .image-preview-inline {
        padding: 10px;
    }
    
    .image-gallery {
        height: 50px;
    }
    
    .image-gallery img {
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION
   ============================================ */
@media only screen and (max-height: 500px) and (orientation: landscape) {
    .chat-container {
        padding: 16px 20px;
        gap: 16px;
    }
    
    .welcome-message {
        padding: 20px 10px 16px;
    }
    
    .welcome-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }
    
    .welcome-title {
        font-size: 18px;
    }
    
    .welcome-subtitle {
        font-size: 13px;
    }
    
    .input-area {
        padding: 12px 16px;
    }
    
    .input-group {
        gap: 8px;
    }
    
    .attach-btn,
    .mic-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    input[type="text"] {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    .send-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .agent-toggle {
        padding: 10px 18px;
        min-height: 44px;
        font-size: 13px;
    }
    
    .message-content {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .app-header {
        padding: 10px 16px;
    }
    
    .app-title {
        font-size: 18px;
    }
}

/* ============================================
   LARGE SCREENS (min-width: 1200px)
   ============================================ */
@media only screen and (min-width: 1200px) {
    .chat-container {
        max-width: 900px;
        padding: 50px 40px;
    }
    
    .agent-cards-grid {
        max-width: 1000px;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .agent-card {
        padding: 20px;
    }
    
    .input-area-bottom {
        max-width: 1200px;
    }
    
    .message {
        max-width: 75%;
    }
    
    .suggested-questions-container {
        max-width: 1000px;
    }
}

/* iOS Safari fix */
@supports (-webkit-touch-callout: none) {
    .chat-wrapper {
        height: -webkit-fill-available;
    }
    
    input[type="text"] {
        font-size: 16px;
    }
}

/* ============================================
   VERY SMALL SCREENS (max-width: 360px)
   ============================================ */
@media only screen and (max-width: 360px) {
    .app-header {
        padding: 10px 12px;
    }
    
    .app-title {
        font-size: 14px;
    }
    
    .chat-container {
        padding: 12px 10px;
        gap: 14px;
    }
    
    .welcome-message {
        padding: 20px 6px 12px;
    }
    
    .welcome-icon {
        font-size: 36px;
    }
    
    .welcome-title {
        font-size: 16px;
    }
    
    .welcome-subtitle {
        font-size: 12px;
    }
    
    .input-area {
        padding: 10px;
    }
    
    .attach-btn,
    .mic-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .send-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .agent-toggle {
        padding: 10px 14px;
        min-height: 44px;
        font-size: 12px;
    }
    
    .agent-card {
        padding: 14px;
    }
    
    .agent-card-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .chat-sidebar {
        width: 240px;
        min-width: 240px;
    }
    
    .sidebar-header {
        width: 240px;
    }
}

/* Touch feedback */
@media (hover: none) and (pointer: coarse) {
    .agent-toggle:active,
    .agent-option:active,
    .control-btn:active,
    .attach-btn:active,
    .mic-btn:active,
    .send-btn:active,
    .agent-card:active,
    .suggested-question-item:active,
    .new-chat-btn:active,
    .minimize-sidebar-btn:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
    
    /* Ensure minimum touch target size (44x44px) */
    .attach-btn,
    .mic-btn,
    .send-btn,
    .new-chat-btn,
    .minimize-sidebar-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .agent-toggle {
        min-height: 44px;
    }
}
