/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Notifications */
.notification {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.notification-message {
    font-size: 14px;
    color: #333;
}

.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0 0 0 10px;
}

.notification-close:hover {
    color: #333;
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-info {
    border-left: 4px solid #3b82f6;
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.auth-header p {
    color: #718096;
    font-size: 0.95rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: #f7fafc;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #718096;
}

.tab-button.active {
    background: white;
    color: #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-button:hover:not(.active) {
    color: #4a5568;
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #4a5568;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #a0aec0;
}

.auth-button {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.auth-button:active {
    transform: translateY(0);
}

.button-spinner {
    display: inline-block;
}

.button-spinner.hidden {
    display: none;
}

.error-message {
    color: #e53e3e;
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Dashboard Container */
.dashboard-container {
    min-height: 100vh;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 2px;
}

.user-info {
    color: #718096;
    font-size: 0.85rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Session Metrics */
.session-metrics {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 16px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.metric-label {
    font-size: 0.75rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Colored indicators for each metric */
#metric-not-started {
    color: #dc2626; /* red */
}

#metric-in-progress {
    color: #f59e0b; /* amber */
}

#metric-completed {
    color: #10b981; /* green */
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #718096;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbb03b;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #48bb78;
    animation: none;
}

.status-dot.disconnected {
    background: #e53e3e;
    animation: none;
}

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

/* Logout Button */
.logout-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #718096;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: #edf2f7;
    color: #4a5568;
}

/* Dashboard Content */
.dashboard-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Conversations Sidebar */
.conversations-sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.conversation-count {
    font-size: 0.8rem;
    color: #718096;
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 12px;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.no-conversations {
    text-align: center;
    padding: 60px 24px;
    color: #a0aec0;
}

.no-conversations-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.no-conversations h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #718096;
    margin-bottom: 8px;
}

.no-conversations p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Conversation Item */
.conversation-item {
    padding: 16px 24px;
    border-bottom: 1px solid #f7fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.conversation-item:hover {
    background: #f7fafc;
}

.conversation-item.active {
    background: #edf2f7;
    border-right: 3px solid #667eea;
}

.conversation-item {
    position: relative;
    transition: all 0.3s ease;
}

.conversation-item.unread {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    position: relative;
}

.conversation-item.unread::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 20px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.unread-indicator {
    display: none; /* Hide the redundant indicator since we use ::after */
}

.conversation-item.unread .conversation-preview {
    font-weight: 600;
    color: #0f172a;
}

.conversation-item.unread .conversation-id {
    color: #0f172a;
    font-weight: 700;
}

.conversation-item.unread .conversation-time {
    color: #16a34a;
    font-weight: 600;
}

.message-count-unread {
    background: #22c55e;
    color: white;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.message-count {
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
}

.conversation-arrived {
    animation: slideInRight 0.5s ease-out, pulseBackground 3s ease-in-out;
}

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

@keyframes pulseBackground {
    0%, 100% {
        background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
        box-shadow: none;
    }
    20% {
        background: linear-gradient(90deg, #93c5fd 0%, #60a5fa 100%);
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    }
    40% {
        background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
        box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
    }
    60% {
        background: linear-gradient(90deg, #93c5fd 0%, #60a5fa 100%);
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    }
    80% {
        background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
        box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
    }
}

.conversation-item.new-message {
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% { background: #fed7d7; }
    100% { background: transparent; }
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.conversation-id {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.conversation-time {
    font-size: 0.75rem;
    color: #a0aec0;
}

.conversation-preview {
    font-size: 0.85rem;
    color: #718096;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-bottom: 8px;
}

.conversation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.status-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #64748b;
}


/* Transcript Panel */
.transcript-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.transcript-header {
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transcript-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.conversation-meta {
    font-size: 0.85rem;
    color: #718096;
    margin: 0;
}

.transcript-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
    scroll-behavior: smooth;
}

.transcript-placeholder {
    text-align: center;
    padding: 80px 24px;
    color: #a0aec0;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 24px;
}

.transcript-placeholder h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #718096;
    margin-bottom: 12px;
}

.transcript-placeholder p {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* Messages */
.message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease-out;
    max-width: 80%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding: 0 4px;
}

.message-speaker {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #718096;
}

.speaker-icon {
    font-size: 1.1rem;
}


.user-message .message-header {
    flex-direction: row-reverse;
}

.user-message .message-speaker {
    color: #667eea;
}

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

.message.user-message {
    margin-left: auto;
}

.message.agent-message {
    margin-right: auto;
}

.message-content {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

/* ============================================
   ORDERS SECTION STYLES
   ============================================ */

/* Split view layout */
.dashboard-content.split-view {
    display: flex;
    height: calc(100vh - 70px);
    gap: 10px;
    padding: 10px;
}

.conversations-section,
.orders-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.conversations-section {
    display: flex;
    flex-direction: row;
}

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

.orders-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.orders-controls {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 10;
}

.control-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.control-btn.sound-off {
    opacity: 0.6;
}

.control-btn.danger-btn {
    background: #dc2626;
    border-color: #b91c1c;
    color: white;
    position: relative;
    z-index: 100;
    font-weight: 500;
}

.control-btn.danger-btn:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #991b1b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.control-btn.danger-btn:active:not(:disabled) {
    transform: translateY(0);
    background: #991b1b;
}

.control-btn.danger-btn:disabled {
    background: #9ca3af;
    border-color: #6b7280;
    color: #d1d5db;
    cursor: not-allowed;
    pointer-events: none;
}

#clear-count {
    font-weight: 700;
    margin-left: 2px;
}

/* Order Columns */
.orders-container {
    display: flex;
    flex: 1;
    gap: 10px;
    padding: 15px;
    overflow: hidden;
}

.order-column {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.column-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #4a5568;
}

.count-badge {
    background: #667eea;
    color: white;
    padding: 2px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

.order-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

/* Order Card */
.order-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Urgency Classes */
.order-card.urgent-green {
    border-color: #48bb78;
    background: #f0fff4;
}

.order-card.urgent-yellow {
    border-color: #f6ad55;
    background: #fffdf7;
}

.order-card.urgent-orange {
    border-color: #ed8936;
    background: #fffaf0;
}

.order-card.urgent-red {
    border-color: #fc8181;
    background: #fff5f5;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(252, 129, 129, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(252, 129, 129, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(252, 129, 129, 0.3);
    }
}

/* Alert Animation */
.alert-flash {
    animation: flash 1s infinite;
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
        border-color: #fc8181;
    }
    50% {
        opacity: 0.6;
        border-color: #f56565;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Order Header */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.order-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4a5568;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 4px;
}

.table-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.order-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-total {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
}

/* Order Timer */
.order-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #718096;
}

.elapsed-time {
    font-weight: 500;
}

.urgent-red .elapsed-time {
    color: #e53e3e;
    font-weight: 700;
}

/* Order Items */
.order-items {
    margin-bottom: 12px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 6px;
}

.order-item {
    padding: 4px 0;
    font-size: 0.95rem;
    color: #4a5568;
}

/* Order Actions */
.order-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.confirm-btn {
    background: #48bb78;
    color: white;
}

.confirm-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.prepare-btn {
    background: #f6ad55;
    color: white;
}

.prepare-btn:hover {
    background: #ed8936;
    transform: translateY(-1px);
}

.ready-btn {
    background: #4299e1;
    color: white;
}

.ready-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.delivered-btn {
    background: #9f7aea;
    color: white;
}

.delivered-btn:hover {
    background: #805ad5;
    transform: translateY(-1px);
}

/* New Order Flash */
.new-order-flash {
    animation: headerFlash 1s;
}

@keyframes headerFlash {
    0%, 100% {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    50% {
        background: linear-gradient(135deg, #f56565 0%, #fc8181 100%);
    }
}

/* Order History */
.order-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.history-header h3 {
    margin: 0;
    color: #4a5568;
}

.history-list {
    flex: 1;
    overflow-y: auto;
}

.history-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.history-card:hover {
    background: #f7fafc;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.history-order-number {
    font-weight: 700;
    color: #2d3748;
    background: #bee3f8;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9rem;
}

.history-table {
    font-weight: 600;
    color: #2d3748;
}

.history-time {
    font-size: 0.85rem;
    color: #718096;
}

.history-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fef5e7;
    color: #f39c12;
}

.status-confirmed {
    background: #e8f5e9;
    color: #27ae60;
}

.status-preparing {
    background: #fff3e0;
    color: #ff9800;
}

.status-ready {
    background: #e3f2fd;
    color: #2196f3;
}

.status-delivered {
    background: #f3e5f5;
    color: #9c27b0;
}

.history-total {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
}

.no-history {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
    font-size: 1rem;
}

.history-items {
    color: #666;
    font-size: 13px;
    margin: 8px 0;
    line-height: 1.4;
}

.history-total {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-top: 5px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.agent-message .message-content {
    background: #f7fafc;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.message-timestamp {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 4px;
    text-align: right;
}

.user-message .message-timestamp {
    text-align: right;
}

.agent-message .message-timestamp {
    text-align: left;
}

/* Transcript Footer */
.transcript-footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
}

.transcript-controls {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.control-button {
    padding: 8px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    color: #718096;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-button:hover:not(:disabled) {
    background: #edf2f7;
    color: #4a5568;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-left: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    color: #718096;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .conversations-sidebar {
        width: 280px;
    }
    
    .dashboard-header {
        padding: 16px 20px;
    }
    
    .transcript-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        flex-direction: column;
    }
    
    .conversations-sidebar {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .transcript-panel {
        flex: 1;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .header-right {
        align-self: flex-end;
    }
    
    .auth-card {
        padding: 30px 24px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        margin: 20px;
        padding: 24px 20px;
    }
    
    .dashboard-header {
        padding: 12px 16px;
    }
    
    .transcript-content {
        padding: 16px;
    }
    
    .conversations-sidebar {
        height: 250px;
    }
    
    .message {
        max-width: 95%;
    }
}

/* Unread messages styling */
.message.unread-message {
    background: linear-gradient(90deg, #fef3c7 0%, #fef9c3 100%);
    border-left: 3px solid #f59e0b;
    animation: fadeInHighlight 0.5s ease-out;
}

.message.unread-message.agent-message {
    background: linear-gradient(90deg, #dcfce7 0%, #d9f99d 100%);
    border-left: 3px solid #22c55e;
}

@keyframes fadeInHighlight {
    from {
        opacity: 0.7;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Unread divider */
.unread-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    position: relative;
}

.unread-divider::before,
.unread-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
}

.unread-divider span {
    padding: 0 15px;
    color: #f59e0b;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Session Status Styles */
.conversation-item.session-not_started {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.conversation-item.session-not_started:hover {
    background: #fee2e2;
}

.conversation-item.session-started {
    background: #fefce8;
    border-left: 4px solid #eab308;
    animation: sessionPulse 2s infinite;
}

.conversation-item.session-started:hover {
    background: #fef9c3;
}

.conversation-item.session-completed {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
}

.conversation-item.session-completed:hover {
    background: #dcfce7;
}

@keyframes sessionPulse {
    0% { opacity: 1; }
    50% { opacity: 0.9; }
    100% { opacity: 1; }
}

/* Session meta styling */
.conversation-item .conversation-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #718096;
    margin: 4px 0;
}

/* Session status badge */
.conversation-item .message-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.conversation-item.session-not_started .message-count {
    background: #fee2e2;
    color: #dc2626;
}

.conversation-item.session-started .message-count {
    background: #fef3c7;
    color: #a16207;
}

.conversation-item.session-completed .message-count {
    background: #dcfce7;
    color: #16a34a;
}