/* AiTril Web Interface - Claude-style Design */

:root {
    /* Colors - Claude-inspired palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary: #e8e8ea;
    --bg-agent: #f0f4f9;

    --text-primary: #2e2e2e;
    --text-secondary: #6b6b6b;
    --text-tertiary: #999999;

    --border-color: #e0e0e0;
    --border-radius: 8px;

    /* Agent colors */
    --agent-gpt: #10a37f;
    --agent-claude: #cc785c;
    --agent-gemini: #4285f4;

    /* Status colors */
    --status-active: #10a37f;
    --status-waiting: #ffa500;
    --status-complete: #6b6b6b;

    /* Phase colors */
    --phase-planning: #8b5cf6;
    --phase-implementation: #3b82f6;
    --phase-review: #10b981;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
}

/* Main Layout */
#app {
    display: flex;
    height: 100vh;
    max-width: 1800px;
    margin: 0 auto;
}

/* Sidebar - Agent Status */
.sidebar {
    width: 320px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.logo {
    font-size: 24px;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.app-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Agent Status Cards */
.agents-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-card {
    background: var(--bg-agent);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    padding: 16px;
    transition: all 0.3s ease;
}

.agent-card.active {
    border-color: var(--status-active);
    box-shadow: 0 0 20px rgba(16, 163, 127, 0.2);
}

.agent-card.gpt.active {
    border-color: var(--agent-gpt);
    box-shadow: 0 0 20px rgba(16, 163, 127, 0.2);
}

.agent-card.claude.active {
    border-color: var(--agent-claude);
    box-shadow: 0 0 20px rgba(204, 120, 92, 0.2);
}

.agent-card.gemini.active {
    border-color: var(--agent-gemini);
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.2);
}

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

.agent-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.agent-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 12px;
}

.agent-icon.gpt {
    background: var(--agent-gpt);
}

.agent-icon.claude {
    background: var(--agent-claude);
}

.agent-icon.gemini {
    background: var(--agent-gemini);
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-complete);
}

.status-dot.active {
    background: var(--status-active);
    animation: pulse 2s ease-in-out infinite;
}

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

.agent-progress {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Phase Indicator */
.phase-indicator {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: auto;
}

.phase-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

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

.phase {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.phase.active {
    background: var(--bg-agent);
    color: var(--text-primary);
    font-weight: 600;
}

.phase-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
}

.phase.active .phase-dot {
    background: var(--status-active);
}

.phase.planning.active .phase-dot {
    background: var(--phase-planning);
}

.phase.implementation.active .phase-dot {
    background: var(--phase-implementation);
}

.phase.review.active .phase-dot {
    background: var(--phase-review);
}

/* Main Chat Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

/* Chat Header */
.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mode-selector {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--border-radius);
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    background: var(--bg-primary);
}

.mode-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    max-width: 800px;
    animation: fadeIn 0.3s ease-in;
}

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

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

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 12px;
}

.message-avatar.user {
    background: #6b6b6b;
}

.message-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 16px;
    font-size: 15px;
    line-height: 1.7;
}

.message.user .message-content {
    background: var(--bg-agent);
}

/* Agent Response Group */
.agent-response-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agent-response {
    display: flex;
    gap: 12px;
}

.agent-response .message-avatar {
    flex-shrink: 0;
}

.agent-response.gpt .message-avatar {
    background: var(--agent-gpt);
}

.agent-response.claude .message-avatar {
    background: var(--agent-claude);
}

.agent-response.gemini .message-avatar {
    background: var(--agent-gemini);
}

.agent-response-content {
    flex: 1;
}

/* Code blocks */
.message-content pre {
    background: var(--text-primary);
    color: #f0f0f0;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    margin: 12px 0;
}

.message-content code {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}

.message-content pre code {
    background: transparent;
    padding: 0;
}

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

.input-wrapper {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.input-field {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: var(--font-sans);
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    border-color: var(--status-active);
}

.send-btn {
    padding: 14px 24px;
    background: var(--status-active);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-btn:hover {
    background: #0d8c6d;
}

.send-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: bounce 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}
