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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #5c78ef 0%, #0043BE 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #1f2937;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Status Card */
.status-card {
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.status-card.live {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.status-card.ai {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.status-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.status-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #1f2937;
}

.status-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 15px;
}

.last-updated {
    font-size: 12px;
    color: #9ca3af;
}

.toggle-button {
    background: linear-gradient(135deg, #5c78ef 0%, #0043BE 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(92, 120, 239, 0.4);
}

.toggle-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(92, 120, 239, 0.6);
}

.toggle-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Divider */
.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 40px 0 30px 0;
}

/* Chats Section */
#chatsSection h2 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 20px;
}

.chats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-chats {
    text-align: center;
    color: #9ca3af;
    padding: 40px 20px;
    font-size: 14px;
}

.chat-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item:hover {
    border-color: #5c78ef;
    background: #f3f4f6;
}

.chat-item-info h4 {
    color: #1f2937;
    font-size: 16px;
    margin-bottom: 4px;
}

.chat-item-info p {
    color: #6b7280;
    font-size: 13px;
}

.chat-item-preview {
    color: #9ca3af;
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}

.chat-item-badge {
    background: #ef4444;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Chat Detail View */
.chat-detail {
    animation: slideIn 0.3s ease;
}

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

.chat-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
}

.back-button {
    background: #f3f4f6;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #1f2937;
    transition: background 0.2s;
}

.back-button:hover {
    background: #e5e7eb;
}

.chat-detail-info h3 {
    color: #1f2937;
    font-size: 18px;
    margin-bottom: 4px;
}

.chat-detail-info p {
    color: #6b7280;
    font-size: 13px;
}

/* Chat Messages */
.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 16px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.message-sender {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.message-time {
    font-size: 12px;
    color: #9ca3af;
}

.message-bubble {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
}

.message.user .message-bubble {
    background: #E8EEFC;
    border-color: #5c78ef;
}

.message.brett .message-bubble {
    background: #d1fae5;
    border-color: #10b981;
}

/* Reply Area */
.chat-reply-area {
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
}

#replyForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#replyInput {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

#replyInput:focus {
    border-color: #5c78ef;
}

.send-button {
    background: #5c78ef;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.send-button:hover {
    background: #0043BE;
}

.send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Loading & Error */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #5c78ef;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error {
    background: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 13px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .status-icon {
        font-size: 40px;
    }
    
    .status-text {
        font-size: 20px;
    }
}
