/* Athus Agent — CSS Styling */

:root {
    --primary: #2563eb;
    --secondary: #1e40af;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg-light: #f9fafb;
    --bg-dark: #1f2937;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border: #d1d5db;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 24px;
    margin: 0;
    color: var(--primary);
}

.logo p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

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

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: var(--success);
}

.status-indicator.offline {
    background: var(--error);
    animation: none;
}

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

/* Main Layout */
.main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px - 60px);
}

.chat-container {
    display: flex;
    gap: 20px;
    height: 100%;
    padding: 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-header h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.session-info {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
}

.session-info p {
    margin: 8px 0;
}

.session-info strong {
    color: var(--primary);
}

.channels h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

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

.channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.channel-item:hover {
    background: var(--bg-light);
}

.channel-item.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    margin-top: auto;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    gap: 20px;
}

.welcome-message h2 {
    font-size: 28px;
    margin: 0;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.quick-action {
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.quick-action:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

/* Messages */
.message {
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
}

.message.user {
    justify-content: flex-end;
}

.message.agent {
    justify-content: flex-start;
}

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

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message.user .message-bubble {
    background: var(--primary);
    color: white;
}

.message.agent .message-bubble {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.message-timestamp {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Input Area */
.input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.message-form {
    width: 100%;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    transition: border-color 0.2s;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-actions {
    display: flex;
    gap: 8px;
}

.recording-indicator {
    margin-top: 8px;
    padding: 8px;
    background: var(--error);
    color: white;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    animation: pulse 1s infinite;
}

.recording-indicator.hidden {
    display: none;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border);
}

.btn-icon:hover {
    background: var(--bg-light);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 15px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.footer p {
    margin: 4px 0;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: -1;
    }

    .message-bubble {
        max-width: 90%;
    }

    .logo h1 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .message-form {
        flex-direction: column;
    }

    .input-group {
        flex-direction: column-reverse;
    }

    .message-input {
        width: 100%;
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-light) 25%, #e5e7eb 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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