/**
 * Dashboard Charts & Tables Styling
 * Modern, aesthetic design for charts and tables
 */

/* ============================================
   CHART CONTAINERS
   ============================================ */

.chart-container {
    position: relative;
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.chart-container:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.2);
}

.chart-wrapper {
    position: relative;
    height: 320px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid transparent;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.1), transparent);
    border-radius: 8px;
    padding: 12px;
    margin: -12px -12px 20px -12px;
}

.chart-title {
    font-size: 17px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.chart-title i {
    color: #667eea;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.chart-action-btn {
    padding: 4px 8px;
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: #6c757d;
}

.chart-action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* ============================================
   CARD ENHANCEMENTS
   ============================================ */

.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.2);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 20px;
    font-weight: 600;
}

.card-header .card-title {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header i {
    font-size: 18px;
}

.card-body {
    padding: 20px;
}

/* ============================================
   TABLE STYLING
   ============================================ */

.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.table thead th {
    background-color: #e7eafa;
    color: #764ba2;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 16px 12px;
    border: none;
    white-space: nowrap;
}

.table thead th:first-child {
    border-top-left-radius: 12px;
}

.table thead th:last-child {
    border-top-right-radius: 12px;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    color: #495057;
    font-size: 14px;
}

.table tbody tr:last-child {
    border-bottom: none;
}

/* Striped rows with subtle color */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(102, 126, 234, 0.03);
}

/* Hover effect for striped tables */
.table-striped tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.08);
}

/* ============================================
   BADGE STYLING
   ============================================ */

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3);
}

.badge.bg-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

.badge.bg-purple {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%) !important;
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.3);
}

.badge.bg-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.badge.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.badge.badge-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3);
}

.badge.badge-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.badge.badge-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

.badge.badge-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.badge.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* ============================================
   CHART LEGEND CUSTOM
   ============================================ */

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #495057;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%);
}

/* ============================================
   DATA CARDS
   ============================================ */

.data-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.data-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.data-card-title {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.data-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.data-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
}

.data-trend {
    display: flex;
    align-items: center;
    gap: 4px;
}

.data-trend.up {
    color: #2ecc71;
}

.data-trend.down {
    color: #e74c3c;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .chart-wrapper {
        height: 250px;
    }

    .table thead th {
        font-size: 11px;
        padding: 12px 8px;
    }

    .table tbody td {
        font-size: 13px;
        padding: 12px 8px;
    }

    .data-card-value {
        font-size: 24px;
    }
}

/* ============================================
   ANIMATION UTILITIES
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   LOADING STATE
   ============================================ */

.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6c757d;
}

.chart-loading i {
    font-size: 32px;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

/* ============================================
   TOOLTIP CUSTOM
   ============================================ */

.custom-tooltip {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-tooltip strong {
    display: block;
    margin-bottom: 4px;
    color: #667eea;
}