/**
 * EA Custom Reports - Admin Styles
 * Professional styling for the reports dashboard
 */

/* Main container */
.ea-custom-reports-wrap {
    margin: 20px 0;
}

.ea-custom-reports-wrap h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: #1d2327;
}

.ea-custom-reports-wrap h1 .dashicons {
    color: #2271b1;
    font-size: 24px;
}

/* Header controls */
.ea-reports-header {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ea-reports-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.ea-select {
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

.ea-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Custom date inputs */
.ea-custom-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.ea-custom-inputs input {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.ea-custom-inputs input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Summary cards */
.ea-reports-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ea-summary-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ea-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ea-summary-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #50575e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ea-summary-amount {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.ea-summary-card.ea-income .ea-summary-amount {
    color: #28a745;
}

.ea-summary-card.ea-expense .ea-summary-amount {
    color: #dc3545;
}

.ea-summary-card.ea-profit .ea-summary-amount.positive {
    color: #28a745;
}

.ea-summary-card.ea-profit .ea-summary-amount.negative {
    color: #dc3545;
}

/* Chart container */
.ea-chart-container {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 400px;
}

.ea-chart-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

#ea-report-chart {
    max-height: 400px;
}

/* Table container */
.ea-table-container {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ea-table-container h2 {
    margin: 0 0 20px 0;
    color: #1d2327;
    font-size: 20px;
}

/* Table styling */
.ea-table-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.ea-table-container th {
    background: #f6f7f7;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 2px solid #c3c4c7;
}

.ea-table-container td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.ea-table-container tr:hover {
    background: #f6f7f7;
}

.ea-table-container .income {
    color: #28a745;
    font-weight: 600;
}

.ea-table-container .expense {
    color: #dc3545;
    font-weight: 600;
}

.ea-table-container .positive {
    color: #28a745;
    font-weight: 600;
}

.ea-table-container .negative {
    color: #dc3545;
    font-weight: 600;
}

/* Loading states */
.ea-loading {
    text-align: center;
    padding: 40px;
    color: #50575e;
    font-size: 16px;
}

.ea-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error and no data states */
.ea-error {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.ea-no-data {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 20px 0;
}

/* Button styling */
.ea-reports-controls .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ea-reports-controls .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ea-reports-controls .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Responsive design */
@media (max-width: 768px) {
    .ea-reports-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ea-select {
        min-width: auto;
    }
    
    .ea-reports-summary {
        grid-template-columns: 1fr;
    }
    
    .ea-summary-amount {
        font-size: 24px;
    }
    
    .ea-custom-inputs {
        flex-direction: column;
    }
    
    .ea-custom-inputs input {
        min-width: auto;
    }
    
    .ea-table-container {
        overflow-x: auto;
    }
    
    .ea-table-container table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .ea-custom-reports-wrap h1 {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .ea-summary-card {
        padding: 20px;
    }
    
    .ea-chart-container,
    .ea-table-container {
        padding: 20px;
    }
}

/* Print styles */
@media print {
    .ea-reports-header,
    .ea-reports-controls {
        display: none;
    }
    
    .ea-summary-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .ea-chart-container,
    .ea-table-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Accessibility improvements */
.ea-select:focus,
.ea-custom-inputs input:focus,
.button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ea-summary-card,
    .ea-chart-container,
    .ea-table-container {
        border-width: 2px;
    }
    
    .ea-table-container th {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ea-summary-card,
    .ea-reports-controls .button {
        transition: none;
    }
    
    .ea-loading::before {
        animation: none;
    }
} 

/* Frontend-specific styles */
.ea-frontend-dashboard-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ea-frontend-dashboard-wrapper .ea-custom-reports-wrap {
    margin: 0;
}

.ea-frontend-dashboard-wrapper .ea-custom-reports-wrap h1 {
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: white;
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ea-frontend-dashboard-wrapper .ea-custom-reports-wrap h1 .dashicons {
    color: white;
}

.ea-frontend-dashboard-wrapper .ea-reports-header {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ea-frontend-dashboard-wrapper .ea-summary-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.ea-frontend-dashboard-wrapper .ea-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ea-frontend-dashboard-wrapper .ea-chart-container {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ea-frontend-dashboard-wrapper .ea-table-container {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ea-frontend-dashboard-wrapper .ea-select {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ea-frontend-dashboard-wrapper .ea-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.ea-frontend-dashboard-wrapper .button {
    background: linear-gradient(135deg, #2271b1, #135e96);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ea-frontend-dashboard-wrapper .button:hover {
    background: linear-gradient(135deg, #135e96, #0d4b78);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ea-frontend-dashboard-wrapper .button-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.ea-frontend-dashboard-wrapper .button-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
}

.ea-frontend-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin: 20px 0;
}

/* Responsive design for frontend */
@media (max-width: 768px) {
    .ea-frontend-dashboard-wrapper {
        padding: 15px;
        margin: 10px;
    }
    
    .ea-frontend-dashboard-wrapper .ea-custom-reports-wrap h1 {
        padding: 15px 20px;
        font-size: 20px;
    }
    
    .ea-frontend-dashboard-wrapper .ea-reports-header {
        padding: 20px;
    }
    
    .ea-frontend-dashboard-wrapper .ea-summary-card,
    .ea-frontend-dashboard-wrapper .ea-chart-container,
    .ea-frontend-dashboard-wrapper .ea-table-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ea-frontend-dashboard-wrapper {
        padding: 10px;
        margin: 5px;
    }
    
    .ea-frontend-dashboard-wrapper .ea-custom-reports-wrap h1 {
        padding: 12px 15px;
        font-size: 18px;
    }
    
    .ea-frontend-dashboard-wrapper .ea-reports-header {
        padding: 15px;
    }
    
    .ea-frontend-dashboard-wrapper .ea-summary-card,
    .ea-frontend-dashboard-wrapper .ea-chart-container,
    .ea-frontend-dashboard-wrapper .ea-table-container {
        padding: 15px;
    }
} 