/**
 * LearnCore Admin Invoice Dashboard Styles
 */

#learncore-admin-invoice-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 30px;
    text-align: center;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 32px;
    color: #2c3e50;
    font-weight: 700;
}

.dashboard-header p {
    margin: 10px 0 0 0;
    font-size: 16px;
    color: #7f8c8d;
}

/* Stats Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.stat-card.loading {
    opacity: 0.7;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.stat-icon {
    font-size: 48px;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.stat-value {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

/* Different gradient colors for each stat card */
.stat-card:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card:nth-child(5) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.dashboard-controls h2 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-controls label {
    font-weight: 500;
    color: #2c3e50;
}

.filter-controls select {
    padding: 8px 16px;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    background: white;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-controls select:hover {
    border-color: #667eea;
}

.filter-controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Invoices Table */
#invoices-table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.invoices-table thead {
    background: #f8f9fa;
}

.invoices-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dfe6e9;
    white-space: nowrap;
}

.invoices-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #ecf0f1;
    color: #34495e;
}

.invoices-table tbody tr {
    transition: background-color 0.2s ease;
}

.invoices-table tbody tr:hover {
    background-color: #f8f9fa;
}

.invoices-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-unpaid {
    background: #fff3cd;
    color: #856404;
}

.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

.status-unknown {
    background: #e2e3e5;
    color: #383d41;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    #learncore-admin-invoice-dashboard {
        padding: 15px;
    }

    .dashboard-header h1 {
        font-size: 24px;
    }

    .dashboard-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-controls {
        width: 100%;
    }

    .filter-controls select {
        flex: 1;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 36px;
    }

    .stat-value {
        font-size: 24px;
    }

    .invoices-table {
        font-size: 12px;
    }

    .invoices-table th,
    .invoices-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .invoices-table th,
    .invoices-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
}

/* Loading and Error States */
#invoices-table-container p {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 16px;
}