/* ========================================== */
/* COMMAND CENTER - HORVÁTH STYLE */
/* Professional, Compact, Dynamic */
/* ========================================== */

.command-center {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.25rem;
    background: #f8fafc;
}

/* ========================================== */
/* ANIMATIONS */
/* ========================================== */

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

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

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

/* ========================================== */
/* HERO / PAGE HEADER */
/* ========================================== */

.command-center-header {
    margin-bottom: 1.25rem;
    animation: fadeSlideUp 0.3s ease-out both;
}

.command-center-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.command-center-subtitle {
    font-size: 0.85rem;
    color: #64748b;
}

/* ========================================== */
/* QUICK STATS BAR */
/* ========================================== */

.command-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    animation: fadeSlideUp 0.3s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

.stat-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.625rem;
}

/* Professional icon circles instead of emojis */
.stat-icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.stat-icon-circle.email {
    background: #dbeafe;
    color: #1e40af;
}

.stat-icon-circle.ai {
    background: #f3e8ff;
    color: #7c3aed;
}

.stat-icon-circle.success {
    background: #d1fae5;
    color: #065f46;
}

.stat-icon-circle.tasks {
    background: #f1f5f9;
    color: #475569;
}

/* CSS checkmark icon */
.check-icon {
    display: inline-block;
    width: 10px;
    height: 6px;
    border-left: 2px solid #065f46;
    border-bottom: 2px solid #065f46;
    transform: rotate(-45deg);
    margin-bottom: 2px;
}

.stat-badge {
    font-size: 0.688rem;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.stat-badge.new {
    background: #dbeafe;
    color: #1e40af;
}

.stat-badge.active {
    background: #fef3c7;
    color: #92400e;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
}

/* ========================================== */
/* MAIN GRID LAYOUT */
/* ========================================== */

.command-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

/* ========================================== */
/* INPUT WIDGET - MANUAL TASK */
/* ========================================== */

.input-widget {
    background: white;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.08);
    animation: fadeSlideUp 0.35s ease-out both;
    animation-delay: 0.1s;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-badge {
    font-size: 0.688rem;
    padding: 0.2rem 0.45rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-weight: 600;
}

.task-input-area {
    margin-bottom: 1rem;
}

.task-input-label {
    display: block;
    font-size: 0.813rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.5rem;
}

.task-input {
    width: 100%;
    min-height: 90px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
    line-height: 1.5;
}

.task-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.task-input::placeholder {
    color: #94a3b8;
    font-size: 0.813rem;
}

.task-examples {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.examples-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.example-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.example-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.625rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.example-tag:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
    transform: translateY(-1px);
}

.input-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-primary {
    flex: 1;
    padding: 0.625rem 1.25rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.625rem 1.25rem;
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* ========================================== */
/* EMAIL WIDGET */
/* ========================================== */

.email-widget {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    animation: fadeSlideUp 0.35s ease-out both;
    animation-delay: 0.15s;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.email-count {
    font-size: 0.8rem;
    color: #64748b;
}

/* Refresh icon (CSS-only) */
.refresh-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
    position: relative;
}

.btn-icon:hover .refresh-icon {
    animation: spin 0.6s linear;
}

.btn-icon {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.813rem;
    font-weight: 600;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    color: #2563eb;
    background: #eff6ff;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 1rem;
}

.email-preview {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.email-preview:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateX(2px);
}

.email-preview.unread {
    border-left: 3px solid #3b82f6;
    background: #fafbfe;
}

.email-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.email-from {
    font-size: 0.813rem;
    font-weight: 600;
    color: #1e293b;
}

.email-time {
    font-size: 0.7rem;
    color: #94a3b8;
}

.email-subject {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.375rem;
}

.email-snippet {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.email-tags {
    display: flex;
    gap: 0.375rem;
}

.email-tag {
    font-size: 0.688rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 500;
}

.email-tag.category {
    background: #f1f5f9;
    color: #475569;
}

.email-tag.status {
    background: #fef3c7;
    color: #92400e;
}

/* ========================================== */
/* TASK QUEUE */
/* ========================================== */

.task-queue {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    animation: fadeSlideUp 0.4s ease-out both;
    animation-delay: 0.2s;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.queue-filters {
    display: flex;
    gap: 0.375rem;
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.task-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    transition: all 0.15s ease;
}

.task-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.task-card.matched {
    border-left: 3px solid #10b981;
    background: #f9fdfb;
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.task-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.task-source {
    font-size: 0.7rem;
    color: #64748b;
}

.task-status-badge {
    font-size: 0.688rem;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
}

.task-status-badge.new {
    background: #dbeafe;
    color: #1e40af;
}

.task-status-badge.analyzing {
    background: #fef3c7;
    color: #92400e;
    animation: pulse 1.5s ease-in-out infinite;
}

.task-status-badge.matched {
    background: #d1fae5;
    color: #065f46;
}

.task-description {
    font-size: 0.813rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.task-match {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.match-agent {
    font-size: 0.813rem;
    font-weight: 600;
    color: #1e40af;
}

.match-confidence {
    font-size: 0.688rem;
    padding: 0.2rem 0.45rem;
    background: #d1fae5;
    color: #065f46;
    border-radius: 3px;
    font-weight: 600;
}

.match-prompt {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-sm.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-sm.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.btn-sm.btn-secondary {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-sm.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ========================================== */
/* AI MATCHING MODAL */
/* ========================================== */

.matching-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    backdrop-filter: blur(2px);
}

.matching-modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    animation: fadeSlideUp 0.25s ease-out;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.25rem;
}

.modal-subtitle {
    font-size: 0.813rem;
    color: #64748b;
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

.user-task-display {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.user-task-label {
    font-size: 0.688rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.user-task-text {
    font-size: 0.875rem;
    color: #1e293b;
    font-style: italic;
}

.match-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.match-result-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.match-result-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.match-result-card.best {
    border-color: #10b981;
    background: #f9fdfb;
}

/* Best Match Badge (replaces trophy emoji) */
.best-match-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    background: #10b981;
    color: white;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 0.375rem;
}

.match-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.match-result-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.2rem;
}

.match-result-category {
    font-size: 0.7rem;
    color: #64748b;
}

.match-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.score-badge {
    font-size: 1.125rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 0.125rem;
}

.score-label {
    font-size: 0.688rem;
    color: #64748b;
}

.match-capabilities {
    margin-bottom: 0.75rem;
}

.capabilities-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.capabilities-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.capabilities-list li {
    font-size: 0.8rem;
    color: #64748b;
    padding: 0.15rem 0;
    padding-left: 1.125rem;
    position: relative;
}

.capabilities-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 8px;
    height: 4px;
    border-left: 2px solid #10b981;
    border-bottom: 2px solid #10b981;
    transform: rotate(-45deg) translateY(-50%);
    margin-top: -2px;
}

.match-result-actions {
    display: flex;
    gap: 0.5rem;
}

/* ========================================== */
/* PROMPT MATCH CARDS (real prompts) */
/* ========================================== */

.match-results-count {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.match-description {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.match-prompt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.meta-tag {
    font-size: 0.688rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

.meta-tag.tier-premium {
    background: #fef3c7;
    color: #92400e;
}

.meta-tag.tier-fundamental {
    background: #dbeafe;
    color: #1e40af;
}

.meta-tag.tier-erweitert {
    background: #f3e8ff;
    color: #7c3aed;
}

.meta-tag.output {
    background: #d1fae5;
    color: #065f46;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ========================================== */
/* LOADING STATE */
/* ========================================== */

.loading-state {
    text-align: center;
    padding: 2rem 1.5rem;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 1rem auto;
}

.loading-text {
    font-size: 0.875rem;
    color: #64748b;
}

/* ========================================== */
/* EMPTY STATE */
/* ========================================== */

.empty-state {
    text-align: center;
    padding: 1.5rem 1rem;
}

.empty-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto;
}

.empty-icon-letter {
    font-size: 0.875rem;
    font-weight: 600;
    color: #94a3b8;
}

/* Legacy emoji icon - hidden if circle is used */
.empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.25rem;
}

.empty-description {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ========================================== */
/* TOAST OVERRIDE (compact) */
/* ========================================== */

.toast-notification {
    font-size: 0.813rem !important;
    padding: 0.75rem 1.25rem !important;
}

/* ========================================== */
/* RESPONSIVE */
/* ========================================== */

@media (max-width: 1024px) {
    .command-main-grid {
        grid-template-columns: 1fr;
    }

    .command-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .command-center {
        padding: 0.75rem;
    }

    .command-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.625rem;
    }

    .input-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .queue-filters {
        flex-wrap: wrap;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}
