/* Pošťák Péťa — Missive Sidebar Styles */

:root {
    --bg-primary: #1E1E1E;
    --bg-secondary: #2A2A2A;
    --bg-tertiary: #333333;
    --accent: #4ECDC4;
    --accent-dim: #3BA89F;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #707070;
    --border: #3A3A3A;
    --error: #E74C3C;
    --success: #2ECC71;
    --warning: #F39C12;
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.logo-icon {
    font-size: 20px;
}

.logo-text {
    color: var(--text-primary);
    font-weight: 300;
}

.logo-text strong {
    color: var(--accent);
    font-weight: 700;
}

.header-sub {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
    padding-left: 28px;
}

/* Sender Card */
.sender-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sender-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.sender-info {
    overflow: hidden;
    min-width: 0;
}

.sender-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sender-email {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sender-subject {
    font-size: 11px;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Context Bar */
.context-bar {
    padding: 6px 16px;
    background: var(--bg-tertiary);
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.empty-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.message {
    max-width: 90%;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-user {
    align-self: flex-end;
    background: var(--accent-dim);
    color: var(--bg-primary);
    border-bottom-right-radius: 2px;
}

.message-assistant {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--border);
}

.message-error {
    align-self: center;
    background: rgba(231, 76, 60, 0.15);
    color: var(--error);
    border: 1px solid rgba(231, 76, 60, 0.3);
    font-size: 12px;
    text-align: center;
}

.message-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Input Area */
.input-area {
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 4px 4px 12px;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
}

textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    resize: none;
    outline: none;
    max-height: 100px;
    padding: 6px 0;
}

textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.send-btn:hover {
    background: var(--accent-dim);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.input-hint {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
}

/* Loading */
.loading {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    z-index: 10;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 12px;
    color: var(--text-secondary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Responsive */
@media (max-height: 500px) {
    .header { padding: 8px 12px 6px; }
    .sender-card { padding: 6px 12px; }
    .chat-messages { padding: 8px 12px; }
}
