/**
 * Business Matching Analytics Page Styles
 *
 * @package		THIC
 * @subpackage	Stats/Business_Matching
 * @author		THIC Development Team
 * @copyright	Copyright (c) 2025, THIC
 * @license		GPL
 *
 * Description: Styles for the business matching analytics page
 * Includes: Stats cards, charts, tables, and responsive designs
 */

/* ========================================
   Page Layout
   ======================================== */
.page-stats-business-matching {
    padding-top: 120px;
    padding-bottom: 150px;
    background-color: #f8fafc; /* Lighter background for better contrast */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #334155;
    min-height: 80vh; /* Ensure full height feel */
}

/* ========================================
   Stats Cards (Modern Soft-Fill)
   ======================================== */
.stats-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* Color Themes */
.stats-card-blue {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
}

.stats-card-green {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
}

.stats-card-red {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
}

/* Icon (Watermark Style) */
.stats-card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(4px);
}

.stats-card-blue .stats-card-icon { color: #2563eb; }
.stats-card-green .stats-card-icon { color: #059669; }
.stats-card-red .stats-card-icon { color: #dc2626; }

/* Content */
.stats-card-content {
    text-align: left;
    position: relative;
    z-index: 2;
    padding-top: 10px;
}

.stats-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
    opacity: 0.8;
}

.stats-card-blue .stats-card-title { color: #1e40af; }
.stats-card-green .stats-card-title { color: #065f46; }
.stats-card-red .stats-card-title { color: #991b1b; }

.stats-card-number {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
    color: #1e293b;
}

.stats-card-unit {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.7;
    margin: 0;
}

/* ========================================
   Table Styles (Fixed Header)
   ======================================== */
.table-responsive {
    border-radius: 16px;
    box-shadow: 0 0 0 1px #e2e8f0;
    overflow: hidden; /* Fixes radius clipping */
}

.table thead th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #e2e8f0; /* Clearer separator */
    font-size: 0.85rem;
    white-space: nowrap; /* Prevent wrapping */
}

.table tbody td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-weight: 500;
}

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

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 0.5em 1em;
    border-radius: 30px; /* Pill shape */
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.badge.bg-primary {
    background: rgba(99, 102, 241, 0.1) !important;
    color: #4f46e5 !important;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2);
}

/* ========================================
   Section & Spacing
   ======================================== */
.section-title h2 {
    font-weight: 800;
    color: #0f172a;
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title p {
    color: #64748b;
    font-size: 1.1rem;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 767px) {
    .page-stats-business-matching {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .stats-card {
        margin-bottom: 1rem;
        padding: 24px;
    }
    
    .stats-card-number {
        font-size: 2.5rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    canvas {
        max-height: 350px !important;
    }
}

/* ========================================
   Period Filter Buttons
   ======================================== */
.btn-period {
    border-radius: 50px !important;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    color: #64748b;
    background: #fff;
    margin: 0 4px;
}

.btn-period:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-period.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-group .btn-period {
    flex: 0 0 auto;
}
