/* ============ APPLE-STYLE THEME ============ */

:root {
    --radius: 14px;
    --radius-sm: 10px;
}

/* Smooth transitions everywhere */
* { -webkit-tap-highlight-color: transparent; }

/* ============ NAVBAR ============ */
.navbar {
    padding: 10px 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-bs-theme="dark"] .navbar { background: rgba(20,20,20,0.85); }
[data-bs-theme="light"] .navbar { background: rgba(255,255,255,0.85); }

.navbar .navbar-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar .nav-actions .btn {
    border-radius: 20px;
    font-size: 13px;
    padding: 4px 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .navbar .nav-actions .nav-user { display: none; }
    .navbar .nav-actions .btn { font-size: 12px; padding: 3px 10px; }
}

/* ============ MOBILE TABS ============ */
.mobile-tabs {
    display: none;
    gap: 6px;
    padding: 10px 16px;
}

.mobile-tabs .btn {
    flex: 1;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0;
    border-width: 2px;
}

@media (max-width: 768px) {
    .mobile-tabs { display: flex; }
}

/* ============ BOARD ============ */
.board-container {
    display: flex;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - 150px);
    overflow-x: auto;
}

.board-column {
    flex: 1;
    min-width: 300px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
}

[data-bs-theme="dark"] .board-column { background: rgba(30,30,30,0.6); }
[data-bs-theme="light"] .board-column { background: rgba(240,240,245,0.8); }

.column-header {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header .badge {
    font-size: 11px;
    border-radius: 12px;
    padding: 3px 9px;
    font-weight: 600;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    -webkit-overflow-scrolling: touch;
}

.board-empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.35;
    font-size: 14px;
}

/* ============ TASK CARDS ============ */
.task-card {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    border-left: 3px solid #666;
    -webkit-user-select: none;
    user-select: none;
}

.task-card:active {
    transform: scale(0.97);
    opacity: 0.8;
}

.task-card.processing {
    animation: pulse-card 2s infinite;
}

@keyframes pulse-card {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

[data-bs-theme="dark"] .task-card { background: rgba(50,50,65,0.7); }
[data-bs-theme="light"] .task-card { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

.task-card .task-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.task-card .task-meta { font-size: 12px; opacity: 0.5; }

.task-card .task-category {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 8px;
    font-weight: 500;
}

/* Category Colors */
.cat-website { border-left-color: #3498db; }
.cat-website .task-category { background: rgba(52,152,219,0.15); color: #5dade2; }
.cat-seo { border-left-color: #2ecc71; }
.cat-seo .task-category { background: rgba(46,204,113,0.15); color: #58d68d; }
.cat-content { border-left-color: #9b59b6; }
.cat-content .task-category { background: rgba(155,89,182,0.15); color: #bb8fce; }
.cat-security { border-left-color: #e74c3c; }
.cat-security .task-category { background: rgba(231,76,60,0.15); color: #ec7063; }
.cat-email { border-left-color: #1abc9c; }
.cat-email .task-category { background: rgba(26,188,156,0.15); color: #48c9b0; }
.cat-bilder { border-left-color: #e67e22; }
.cat-bilder .task-category { background: rgba(230,126,34,0.15); color: #f0b27a; }
.cat-blog { border-left-color: #f39c12; }
.cat-blog .task-category { background: rgba(243,156,18,0.15); color: #f7c948; }
.cat-social { border-left-color: #e84393; }
.cat-social .task-category { background: rgba(232,67,147,0.15); color: #f06292; }
.cat-system { border-left-color: #636e72; }
.cat-system .task-category { background: rgba(99,110,114,0.15); color: #95a5a6; }
.cat-allgemein { border-left-color: #74b9ff; }
.cat-allgemein .task-category { background: rgba(116,185,255,0.15); color: #85c1e9; }

/* Progress bar */
.task-progress { height: 3px; border-radius: 2px; margin-top: 10px; overflow: hidden; }
[data-bs-theme="dark"] .task-progress { background: rgba(255,255,255,0.08); }
[data-bs-theme="light"] .task-progress { background: #e0e0e0; }
.task-progress-bar { height: 100%; border-radius: 2px; transition: width 0.3s; }

.column-erledigt .task-card { opacity: 0.5; }

/* ============ TASK INPUT ============ */
.task-input-bar {
    padding: 12px 16px;
    border-top: 1px solid;
    position: sticky;
    bottom: 0;
}

[data-bs-theme="dark"] .task-input-bar { border-color: rgba(255,255,255,0.08); background: rgba(15,15,20,0.95); }
[data-bs-theme="light"] .task-input-bar { border-color: #e0e0e0; background: rgba(255,255,255,0.95); }

.task-input-bar input, .task-input-bar select {
    border-radius: 20px !important;
}

.task-input-bar .btn-primary {
    border-radius: 20px;
}

/* ============ DETAIL PANEL (custom) ============ */
.detail-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
}

.detail-overlay.open { display: block; }

body.panel-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.detail-panel {
    position: fixed;
    top: 0; right: -100%; bottom: 0;
    width: min(500px, 100vw);
    height: 100%;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.detail-panel.open { right: 0; }

[data-bs-theme="dark"] .detail-panel { background: #1a1a1f; }
[data-bs-theme="light"] .detail-panel { background: #fff; }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid;
}

[data-bs-theme="dark"] .detail-header { border-color: rgba(255,255,255,0.08); }
[data-bs-theme="light"] .detail-header { border-color: #e0e0e0; }

.detail-header h5 { margin: 0; font-weight: 700; font-size: 17px; }

.detail-close {
    background: none; border: none; font-size: 28px; line-height: 1;
    opacity: 0.5; cursor: pointer; padding: 0 4px; color: inherit;
}

.detail-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid;
}

[data-bs-theme="dark"] .detail-meta { border-color: rgba(255,255,255,0.08); }
[data-bs-theme="light"] .detail-meta { border-color: #e0e0e0; }

.detail-footer {
    padding: 12px 16px;
    border-top: 1px solid;
}

[data-bs-theme="dark"] .detail-footer { border-color: rgba(255,255,255,0.08); }
[data-bs-theme="light"] .detail-footer { border-color: #e0e0e0; }

.task-detail-messages {
    flex: 1;
    overflow-y: scroll;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    overscroll-behavior: contain;
}

.msg-user, .msg-agent {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.65;
    word-break: break-word;
}

.msg-user {
    white-space: pre-wrap;
    max-width: 85%;
}

[data-bs-theme="dark"] .msg-user { background: rgba(60,60,120,0.4); color: #e0e0e0; }
[data-bs-theme="dark"] .msg-agent { background: rgba(40,40,45,0.8); color: #e8e8e8; border: 1px solid rgba(255,255,255,0.06); }
[data-bs-theme="light"] .msg-user { background: #007aff; color: #fff; }
[data-bs-theme="light"] .msg-agent { background: #f0f0f0; color: #1c1c1e; }

.msg-role { font-size: 11px; opacity: 0.45; margin-bottom: 4px; font-weight: 600; }

/* Thinking indicator */
.thinking-dots { display: flex; gap: 5px; padding: 4px 0; }
.thinking-dots span {
    width: 8px; height: 8px; border-radius: 50%;
    background: currentColor; opacity: 0.4;
    animation: thinking 1.4s infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinking {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Markdown */
.msg-agent h1, .msg-agent h2, .msg-agent h3 { font-size: 16px; font-weight: 700; margin: 14px 0 6px 0; }
.msg-agent h2 { font-size: 15px; }
.msg-agent h3 { font-size: 15px; }
.msg-agent p { margin: 8px 0; }
.msg-agent ul, .msg-agent ol { margin: 8px 0; padding-left: 22px; }
.msg-agent li { margin: 4px 0; }
.msg-agent strong { font-weight: 700; }
.msg-agent code { font-size: 13px; padding: 2px 6px; border-radius: 5px; }
[data-bs-theme="dark"] .msg-agent code { background: rgba(255,255,255,0.08); }
[data-bs-theme="light"] .msg-agent code { background: rgba(0,0,0,0.05); }
.msg-agent pre { font-size: 13px; padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 8px 0; }
[data-bs-theme="dark"] .msg-agent pre { background: rgba(0,0,0,0.25); }
[data-bs-theme="light"] .msg-agent pre { background: rgba(0,0,0,0.04); }

/* ============ MOBILE ============ */
@media (max-width: 768px) {
    .board-container {
        flex-direction: column;
        height: auto;
        padding: 8px 12px;
        gap: 0;
    }
    .board-column {
        max-width: 100%;
        min-width: 100%;
        min-height: 45vh;
    }
    .board-column.d-none-mobile { display: none !important; }
    .board-column.d-show-mobile { display: flex !important; }

    .task-input-bar .d-flex {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .task-input-bar select { max-width: 100% !important; }
    .task-input-bar .btn { width: 100%; }
}

@media (min-width: 769px) {
    .mobile-tabs { display: none; }
}

/* ============ ADMIN ============ */
.admin-hint { font-size: 13px; opacity: 0.6; margin-bottom: 16px; }

.admin-section-desc {
    font-size: 13px;
    opacity: 0.7;
    padding: 12px 16px;
    line-height: 1.5;
    border-bottom: 1px solid;
}

[data-bs-theme="dark"] .admin-section-desc { border-color: rgba(255,255,255,0.06); }
[data-bs-theme="light"] .admin-section-desc { border-color: #e0e0e0; }

/* Agent Cards in Admin */
.agent-card {
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    border-left: 3px solid #444;
}

[data-bs-theme="dark"] .agent-card { background: rgba(40,40,50,0.6); }
[data-bs-theme="light"] .agent-card { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

.agent-card.border-success { border-left-color: #2ecc71; }

.agent-desc {
    font-size: 13px;
    opacity: 0.7;
    margin: 6px 0;
    line-height: 1.4;
}

.agent-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    opacity: 0.5;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .agent-meta { flex-direction: column; gap: 2px; }
}

/* ============ LOGIN ============ */
.login-card {
    border-radius: var(--radius) !important;
    border: none !important;
}

[data-bs-theme="dark"] .login-card { background: rgba(30,30,35,0.8) !important; }

.login-card .form-control {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 16px;
}

.login-card .btn {
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
}
