/*
 * File: output-area.css
 * Desc: Styles for the Output Component - content display area for tabbed outputs
 */

/* ==================== OUTPUT CONTAINER ==================== */

.output-container {
    position: absolute;
    bottom: 100px; /* Above tab bar (tab bar is at 60px + ~40px height) */
    left: var(--sidebar-width, 250px);
    right: 0;
    max-height: 50vh;
    background: white;
    border-top: 2px solid var(--primary-purple, #8B7EC8);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 90;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.output-container.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==================== OUTPUT HEADER ==================== */

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #f0f5f5);
    border-bottom: 1px solid #e1e5e9;
    min-height: 60px;
}

.output-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.output-icon {
    font-size: 1.5rem;
}

.output-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray, #333);
}

.output-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
}

/* ==================== OUTPUT ACTIONS ==================== */

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

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-gray, #333);
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: var(--primary-purple, #8B7EC8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.action-icon {
    font-size: 1rem;
}

.action-label {
    font-size: 0.85rem;
}

/* ==================== OUTPUT CONTENT ==================== */

.output-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: white;
}

/* Scrollbar styling */
.output-content::-webkit-scrollbar {
    width: 8px;
}

.output-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.output-content::-webkit-scrollbar-thumb {
    background: #8B7EC8;
    border-radius: 4px;
}

.output-content::-webkit-scrollbar-thumb:hover {
    background: #7FB069;
}

/* ==================== TEXT OUTPUT ==================== */

.output-text {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1.5rem;
}

.output-text pre {
    margin: 0;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333;
}

/* ==================== CUSTOMER CARD ==================== */

.customer-card {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #48BB78, #38A169);
    color: white;
}

.customer-name-section h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.customer-id {
    font-size: 0.85rem;
    opacity: 0.9;
}

.customer-status {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
}

.status-active {
    background: rgba(72, 187, 120, 0.3) !important;
}

.status-inactive {
    background: rgba(229, 62, 62, 0.3) !important;
}

.status-prospect {
    background: rgba(245, 158, 11, 0.3) !important;
}

.customer-details {
    padding: 1.5rem;
    background: white;
}

.detail-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #666;
    min-width: 150px;
}

.detail-value {
    color: #333;
}

/* ==================== EMAIL PREVIEW ==================== */

.email-preview {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.email-header-fields {
    padding: 1.5rem;
    background: #f8f9fa;
}

.email-field {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.email-field strong {
    min-width: 80px;
    color: #666;
}

.email-field span {
    color: #333;
}

.email-divider {
    height: 2px;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
}

.email-body {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    min-height: 200px;
}

.ai-badge-email {
    padding: 0.75rem 1.5rem;
    background: #fff3cd;
    border-top: 1px solid #ffc107;
    font-size: 0.85rem;
    color: #856404;
    text-align: center;
}

/* ==================== STATS DISPLAY ==================== */

.stats-display {
    background: white;
}

.stats-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa, #f0f5f5);
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #3B82F6;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-percent {
    font-size: 0.85rem;
    color: #48BB78;
    font-weight: 600;
    margin-top: 0.25rem;
}

.stats-meta {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* ==================== AI OUTPUT ==================== */

.ai-output {
    background: white;
}

.ai-prompt-section {
    padding: 1rem 1.5rem;
    background: #f0f5f5;
    border-left: 4px solid #7FB069;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.ai-section-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-prompt-text {
    margin: 0;
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
}

.ai-response-section {
    padding: 1rem 1.5rem;
    background: #fff9f0;
    border-left: 4px solid #F59E0B;
    border-radius: 4px;
}

.ai-response-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.ai-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
    font-size: 0.85rem;
    color: #999;
}

/* ==================== DATA TABLE ==================== */

.data-table-container {
    background: white;
}

.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e1e5e9;
}

.table-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    color: white;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 0.75rem 1rem;
    color: #333;
}

/* ==================== ERROR MESSAGE ==================== */

.error-message {
    padding: 1.5rem;
    background: #ffe5e5;
    border: 1px solid #ff9999;
    border-radius: 8px;
    color: #cc0000;
    font-weight: 500;
    text-align: center;
}

/* ==================== RESPONSIVE (MOBILE) ==================== */

@media (max-width: 768px) {
    .output-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 100vh;
        z-index: 1000;
        border-top: none;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .output-title-section {
        width: 100%;
    }

    .output-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        min-width: 100px;
    }

    .action-label {
        display: none;
    }

    .output-content {
        padding: 1rem;
    }

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

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

    .customer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-label {
        min-width: auto;
        font-size: 0.85rem;
    }

    /* Mobile: Add close button at top */
    .output-container.mobile::before {
        content: '×';
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 32px;
        height: 32px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 10;
    }
}

/* ==================== UTILITY CLASSES ==================== */

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.p-1 {
    padding: 0.5rem;
}

.font-bold {
    font-weight: 600;
}

.text-muted {
    color: #999;
}
