/**
 * Kaspa Admin Dashboard Styles
 * Modern, clean design for the Kaspa payment admin interface
 */

/* ==========================================================================
   Main Dashboard Layout
   ========================================================================== */

.kaspa-admin-dashboard {
    background: #f1f1f1;
    margin: 0 -20px -10px -20px;
    padding: 20px;
}

.kaspa-admin-dashboard h1 {
    color: #1d2327;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   Statistics Grid
   ========================================================================== */

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

.kaspa-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kaspa-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #70D0F0, #4FC3F7);
}

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

.kaspa-stat-card .kaspa-stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.kaspa-stat-card h3 {
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.kaspa-stat-card p {
    font-size: 14px;
    color: #646970;
    margin: 0 0 8px 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kaspa-stat-card small {
    font-size: 12px;
    color: #70D0F0;
    font-weight: 600;
}

/* ==========================================================================
   System Status
   ========================================================================== */

.kaspa-system-status {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
}

.kaspa-system-status h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #1d2327;
}

.kaspa-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.kaspa-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    transition: all 0.3s ease;
}

.kaspa-status-item:hover {
    background: #f0f8ff;
    border-color: #70D0F0;
}

.kaspa-status-indicator {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.kaspa-status-indicator.loading {
    animation: spin 1s linear infinite;
}

.kaspa-status-indicator.success {
    color: #00a32a;
}

.kaspa-status-indicator.error {
    color: #d63384;
}

.kaspa-status-text {
    font-size: 12px;
    color: #646970;
    margin-left: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Recent Orders Section
   ========================================================================== */

.kaspa-recent-orders {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
}

.kaspa-recent-orders h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #1d2327;
}

.kaspa-orders-table .wp-list-table {
    border: none;
    box-shadow: none;
}

.kaspa-orders-table .wp-list-table th {
    background: #f9f9f9;
    border-bottom: 2px solid #70D0F0;
    font-weight: 600;
    color: #1d2327;
    padding: 12px;
}

.kaspa-orders-table .wp-list-table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.kaspa-orders-table .wp-list-table tr:hover {
    background: #f9f9f9;
}

.kaspa-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kaspa-status-badge.completed,
.kaspa-status-badge.processing {
    background: #d1e7dd;
    color: #0f5132;
}

.kaspa-status-badge.on-hold,
.kaspa-status-badge.pending {
    background: #fff3cd;
    color: #664d03;
}

.kaspa-status-badge.failed,
.kaspa-status-badge.cancelled {
    background: #f8d7da;
    color: #842029;
}

/* ==========================================================================
   Analytics Page Styles
   ========================================================================== */

.kaspa-analytics {
    background: #f1f1f1;
    margin: 0 -20px -10px -20px;
    padding: 20px;
}

.kaspa-analytics-controls {
    background: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kaspa-analytics-controls select {
    min-width: 150px;
}

.kaspa-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.kaspa-analytics-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
}

.kaspa-analytics-card.full-width {
    grid-column: 1 / -1;
}

.kaspa-analytics-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1d2327;
    font-weight: 600;
}

.kaspa-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kaspa-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.kaspa-metric:last-child {
    border-bottom: none;
}

.kaspa-metric-label {
    font-size: 14px;
    color: #646970;
    font-weight: 500;
}

.kaspa-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
}

.kaspa-detailed-analytics {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
}

.kaspa-detailed-analytics h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1d2327;
    font-weight: 600;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
    .kaspa-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .kaspa-admin-dashboard,
    .kaspa-analytics {
        margin: 0 -10px -10px -10px;
        padding: 15px;
    }

    .kaspa-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .kaspa-stat-card {
        padding: 20px;
    }

    .kaspa-analytics-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .kaspa-analytics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .kaspa-status-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.kaspa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #646970;
    font-size: 14px;
}

.kaspa-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #70D0F0;
    border-top: 2px solid transparent;
    border-radius: 50%;
    margin-right: 12px;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.kaspa-text-success {
    color: #00a32a !important;
}

.kaspa-text-warning {
    color: #dba617 !important;
}

.kaspa-text-error {
    color: #d63384 !important;
}

.kaspa-text-muted {
    color: #646970 !important;
}

.kaspa-mb-0 {
    margin-bottom: 0 !important;
}

.kaspa-mb-1 {
    margin-bottom: 8px !important;
}

.kaspa-mb-2 {
    margin-bottom: 16px !important;
}

.kaspa-mb-3 {
    margin-bottom: 24px !important;
}

.kaspa-mt-0 {
    margin-top: 0 !important;
}

.kaspa-mt-1 {
    margin-top: 8px !important;
}

.kaspa-mt-2 {
    margin-top: 16px !important;
}

.kaspa-mt-3 {
    margin-top: 24px !important;
}

.kaspa-p-0 {
    padding: 0 !important;
}

.kaspa-p-1 {
    padding: 8px !important;
}

.kaspa-p-2 {
    padding: 16px !important;
}

.kaspa-p-3 {
    padding: 24px !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    .kaspa-admin-dashboard,
    .kaspa-analytics {
        background: #fff !important;
        margin: 0 !important;
        padding: 20px !important;
        box-shadow: none !important;
    }

    .kaspa-stat-card,
    .kaspa-analytics-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .button {
        display: none !important;
    }
}