/*
What this file does:
- Full path: /var/www/html/oma-agentti.codestan.fi/style.css
- Provides compact dark UI for OmaAgentti.
- Layout: left col-md-3 Työkalut and right personal assistant chat.
*/

:root {
    --app-bg: #111827;
    --panel-bg: #182130;
    --panel-soft: #111827;
    --input-bg: #0f172a;
    --border: #2f3b4f;
    --border-strong: #3b475c;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bubble: #1f2937;
}

body {
    background: var(--app-bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
}

.app-shell {
    width: min(1500px, calc(100vw - 20px));
    max-width: none;
}

.panel-card {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.panel-title {
    color: #f9fafb;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 3px;
}

.panel-subtitle,
.small-note,
.status-line {
    color: var(--muted);
}

.login-card {
    margin-top: 10vh;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.18);
    color: #93c5fd;
    border: 1px solid rgba(147, 197, 253, 0.22);
}

.form-control,
.form-control:focus {
    background: var(--input-bg);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: none;
}

.form-control::placeholder {
    color: #6b7280;
}

.btn {
    border-radius: 8px;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline-light {
    color: #d1d5db;
    border-color: #4b5563;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
    color: #ffffff;
    background: #374151;
    border-color: #6b7280;
}

.assistant-layout {
    max-width: none;
    margin: 0 auto;
}

.assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.assistant-user-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workspace {
    height: calc(100vh - 104px);
    min-height: 0;
}

.workspace > aside,
.workspace > section {
    min-height: 0;
}

.tools-panel,
.chat-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-panel-title {
    color: #f9fafb;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tool-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 9px 10px;
    text-align: left;
}

.tool-button:hover,
.tool-button:focus {
    background: #202b3d;
    border-color: var(--border-strong);
}

.tools-placeholder {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.chat-box {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--panel-soft);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px;
}

.chat-row {
    display: flex;
    margin-bottom: 8px;
}

.chat-row.user {
    justify-content: flex-end;
}

.chat-row.assistant {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 88%;
    padding: 8px 10px;
    border-radius: 10px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.42;
    background: var(--bubble);
    color: #e5e7eb;
    border: 1px solid var(--border);
}

.chat-row.user .chat-bubble {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #2563eb;
}

.chat-row.assistant .chat-bubble {
    background: #202b3d;
    border-color: #3b475c;
}

.chat-author {
    display: block;
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 700;
    margin-bottom: 4px;
}

.chat-message-text {
    font-size: 14px;
}

.chat-time,
.chat-edited {
    display: inline-block;
    margin-top: 5px;
    margin-right: 7px;
    color: #9ca3af;
    font-size: 11px;
}

.chat-input {
    min-height: 70px;
    resize: vertical;
}

.assistant-actions {
    display: flex;
    justify-content: flex-end;
}

.empty-chat-note {
    color: var(--muted);
    padding: 10px;
    text-align: center;
}

.small-empty-note {
    font-size: 13px;
    padding: 6px;
}

.typing-indicator {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    margin-left: 5px;
}

.typing-indicator span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    opacity: 0.4;
    animation: typingPulse 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.16s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes typingPulse {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.command-item {
    width: 100%;
    display: block;
    background: var(--panel-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    text-align: left;
}

.command-item + .command-item {
    margin-top: 8px;
}

.command-item:hover,
.command-item:focus {
    background: #202b3d;
    border-color: var(--border-strong);
}

.command-title,
.command-example,
.command-description {
    display: block;
}

.command-title {
    font-weight: 700;
}

.command-example {
    color: #bfdbfe;
    margin-top: 4px;
}

.command-description {
    color: var(--muted);
    margin-top: 4px;
    font-size: 13px;
}

.capabilities-list {
    margin: 0;
    padding-left: 18px;
}

.capabilities-list li + li {
    margin-top: 6px;
}

.chat-context-menu {
    position: absolute;
    z-index: 2000;
    background: #0f172a;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.chat-context-menu button {
    display: block;
    width: 150px;
    background: transparent;
    color: var(--text);
    border: 0;
    padding: 8px 10px;
    text-align: left;
}

.chat-context-menu button:hover {
    background: #1f2937;
}

@media (max-width: 767.98px) {
    .app-shell {
        width: 100%;
    }

    .assistant-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace {
        height: auto;
    }

    .chat-panel {
        min-height: 70vh;
    }
}
