/**
 * Debug Dashboard Component
 * Debug logging interface with filters and tables
 *
 * @package BeepBeep_AI
 * @since 5.0.0
 */

/* ==================================================
   DEBUG STATS CARD
   ================================================== */

.bbai-debug-stats-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.bbai-debug-stats-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.bbai-debug-stats-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bbai-debug-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    border-top: 1px solid #f3f4f6;
    padding-top: 24px;
}

.bbai-debug-stat-item {
    display: flex;
    flex-direction: column;
}

.bbai-debug-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.bbai-debug-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.bbai-debug-stat-value--warning {
    color: #f59e0b;
}

.bbai-debug-stat-value--error {
    color: #ef4444;
}

.bbai-debug-stat-value--small {
    font-size: 16px;
    font-weight: 600;
}

/* ==================================================
   DEBUG FILTERS
   ================================================== */

.bbai-debug-filters-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-filters-form {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.bbai-debug-filter-group {
    flex: 1;
    min-width: 150px;
}

.bbai-debug-filter-group--search {
    flex: 2;
    min-width: 200px;
}

.bbai-debug-filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.bbai-debug-filter-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #6b7280;
}

.bbai-debug-filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    transition: border-color 0.15s, box-shadow 0.15s;
}

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

.bbai-debug-filter-actions {
    display: flex;
    gap: 8px;
}

/* ==================================================
   DEBUG BUTTONS
   ================================================== */

.bbai-debug-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

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

.bbai-debug-btn--secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.bbai-debug-btn--secondary:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.bbai-debug-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bbai-debug-btn--upsell {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 15px;
}

/* ==================================================
   DEBUG TABLE
   ================================================== */

.bbai-debug-table-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-table {
    width: 100%;
    border-collapse: collapse;
}

.bbai-debug-table thead {
    background: #f9fafb;
}

.bbai-debug-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.bbai-debug-table-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.bbai-debug-table-row:nth-child(even) {
    background: #fafbfc;
}

.bbai-debug-table-row:hover {
    background: #f9fafb;
}

.bbai-debug-table-cell {
    padding: 10px 16px;
    font-size: 13px;
    color: #374151;
}

.bbai-debug-table-cell--timestamp {
    color: #6b7280;
    white-space: nowrap;
}

.bbai-debug-table-cell--message {
    color: #111827;
    max-width: 500px;
    word-break: break-word;
}

.bbai-debug-table-empty {
    text-align: center;
    padding: 60px 24px;
    color: #6b7280;
    font-size: 14px;
}

/* ==================================================
   DEBUG BADGE
   ================================================== */

.bbai-debug-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.bbai-debug-badge-icon {
    font-size: 14px;
    line-height: 1;
}

.bbai-debug-badge-text {
    line-height: 1.4;
}

/* ==================================================
   DEBUG CONTEXT
   ================================================== */

.bbai-debug-context-toggle {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.15s;
}

.bbai-debug-context-toggle:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.bbai-debug-context-toggle.is-expanded {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.bbai-debug-context-empty {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

.bbai-debug-context-row {
    background: #fafbfc;
}

.bbai-debug-context-cell {
    padding: 0;
}

.bbai-debug-context-content {
    padding: 16px;
    background: #1f2937;
    border-radius: 6px;
    margin: 8px 16px;
}

.bbai-debug-context-json {
    margin: 0;
    padding: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #e5e7eb;
    background: transparent;
    border: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.bbai-debug-context-json::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.bbai-debug-context-json::-webkit-scrollbar-track {
    background: #111827;
    border-radius: 4px;
}

.bbai-debug-context-json::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

.bbai-debug-context-json::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* ==================================================
   DEBUG UPSELL
   ================================================== */

.bbai-debug-upsell-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid #bfdbfe;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-upsell-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e40af;
    margin: 0 0 20px;
}

.bbai-debug-upsell-features {
    list-style: none;
    padding: 0;
    margin: 0 0 0;
    display: inline-block;
    text-align: left;
}

.bbai-debug-upsell-features li {
    font-size: 14px;
    color: #1e40af;
    margin-bottom: 10px;
    padding-left: 24px;
    position: relative;
}

.bbai-debug-upsell-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

.bbai-debug-upsell-btn {
    margin-top: 32px;
    padding: 12px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.bbai-debug-upsell-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* ==================================================
   DEBUG PAGINATION
   ================================================== */

.bbai-debug-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-pagination-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

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

@media (max-width: 768px) {
    .bbai-debug-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .bbai-debug-filters-form {
        flex-direction: column;
        align-items: stretch;
    }

    .bbai-debug-filter-group {
        min-width: 100%;
    }

    .bbai-debug-filter-actions {
        width: 100%;
        justify-content: stretch;
    }

    .bbai-debug-filter-actions .bbai-debug-btn {
        flex: 1;
    }

    .bbai-debug-pagination {
        flex-direction: column;
        gap: 16px;
    }

    .bbai-debug-pagination-info {
        order: -1;
    }
}

@media (max-width: 480px) {
    .bbai-debug-stats-grid {
        grid-template-columns: 1fr;
    }
}
