/* WooCommerce POS Reports Admin Styles */

.popay-pos-reports {
    margin: 20px 0;
    padding-right: 20px;
}

.popay-pos-reports h1 {
    color: #23282d;
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 1rem 0;
    padding: 9px 0 4px 0;
    line-height: 1.3;
}

/* Header Section */
.popay-pos-reports-header {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3%;
}

.date-filters {
    display: flex;
    align-items: flex-end;
    flex: 1;
    gap: 15px;
    flex-wrap: wrap;
}

.date-filters .data-filter-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: flex-end;
    flex: 1;
    max-width: 20%;
}

.date-filters .button,
.export-options .button {
    margin: 0;
}

.date-filters label {
    font-weight: 600;
    color: #23282d;
    margin: 0;
}

.date-filters input[type="text"] {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
    line-height: 1.4;
    min-width: 120px;
}

.export-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: initial;
    gap: 5px;
}

.export-options label {
    font-weight: 600;
    color: #23282d;
    margin: 0;
    max-width: 100%;
    flex-basis: 100%;
}

.export-options select {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.4;
    min-width: 100px;
    flex: 1;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.loading-indicator .spinner {
    float: none;
    margin: 0 auto 20px auto;
}

.loading-indicator p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
}

.card-icon {
    font-size: 24px;
    opacity: 0.7;
}

.card-content {
    text-align: center;
    margin-bottom: 15px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: #23282d;
    line-height: 1;
    margin-bottom: 5px;
}

.card-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f1;
}

.card-amount {
    font-size: 20px;
    font-weight: 600;
    color: #0073aa;
}

.card-percentage {
    font-size: 18px;
    font-weight: 600;
    color: #46b450;
}

.card-percentage-label {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Card Colors */
.card.pos-orders {
    border-left: 4px solid #0073aa;
}

.card.regular-orders {
    border-left: 4px solid #46b450;
}

.card.total-revenue {
    border-left: 4px solid #ffb900;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
}

.chart-container canvas {
    max-width: 100%;
    height: clamp(350px, 25vw, 768px) !important;
}

/* Employee Performance Section */
.employee-section {
    margin-bottom: 30px;
}

.employee-table {
    max-width: 100% !important;
    margin: 0 auto;
}

.employee-section .table-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #9b59b6;
}

.employee-section h3 {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 600;
    color: #23282d;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f1;
}

/* Tables Section */
.tables-section {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: stretch;
    align-items: flex-start;
}

.table-container {
    flex: 1 1 0;
    min-width: 0;
    max-width: 50%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-container h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th {
    background: #f9f9f9;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #ccd0d4;
}

.table-container td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.table-container tr:hover {
    background: #f9f9f9;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .button {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.4;
}

/* No Data Message */
.no-data-message {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-data-message h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #23282d;
}

.no-data-message p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Responsive Design */

@media (min-width: 1201px) and (max-width: 1360px) {
    .export-options {
         max-width: 23%;
    }

    .date-filters .data-filter-block {
         max-width: 18.6%;
    }
}

@media (min-width: 769px) {
    .employee-section {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .employee-section .table-container {
        max-width: 50% !important;
        flex-basis: 50%;
    }
}

@media (max-width: 1200px) {
    .date-filters {
        max-width: 100%;
        flex-basis: 100%;
    }

    .popay-pos-reports-header {
        gap: 20px;
    }
}

@media (max-width: 1140px) {
    .popay-pos-reports .table-container table#pos_orders_table,
    .popay-pos-reports .table-container table#daily_breakdown_table {
        overflow-x: auto;
        overflow-y: hidden;
        display: block;
    }

    .popay-pos-reports .table-container table#pos_orders_table > *,
    .popay-pos-reports .table-container table#daily_breakdown_table > * {
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .tables-section {
        flex-direction: column;
    }

    .popay-pos-reports-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-filters {
        justify-content: center;
    }

    .popay-pos-reports-header .date-filters {
        align-items: initial;
        gap: 10px;
        width: 100%;
    }

    .date-filters .data-filter-block {
        flex-basis: calc(50% - 8px);
        max-width: calc(50% - 8px);
    }

    .popay-pos-reports-header .date-filters input,
    .popay-pos-reports-header .date-filters select {
        width: 100%;
    }
    
    .export-options {
        justify-content: center;
    }

    .popay-pos-reports-header .export-options {
        flex-wrap: wrap;
        border-top: 2px solid #ccc;
        padding-top: 20px;
        justify-content: initial;
    }

    .popay-pos-reports-header .export-options label {
        flex-basis: 100%;
        max-width: 100%;
    }

    .popay-pos-reports-header .export-options select {
        flex: 1;
    }

    .popay-pos-reports-header .export-options button {
        margin: 0;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .popay-pos-reports .summary-cards {
        gap: 0;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        min-height: 300px;
    }
    
    .employee-section .table-container {
        padding: 15px;
    }
    
    .employee-section h3 {
        font-size: 18px;
    }
}

@media (max-width: 900px) {
    .table-container {
        max-width: 100%;
    }
}

/* Animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-cards .card {
    min-width: auto;
    max-width: 100%;
    animation: fadeInUp 0.6s ease-out;
}

.summary-cards .card:nth-child(1) { animation-delay: 0.1s; }
.summary-cards .card:nth-child(2) { animation-delay: 0.2s; }
.summary-cards .card:nth-child(3) { animation-delay: 0.3s; }

/* Currency formatting */
.currency {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Status indicators */
.status-pos {
    color: #0073aa;
    font-weight: 600;
}

.status-regular {
    color: #46b450;
    font-weight: 600;
}

.popay-pos-reports .pagination {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

@media screen and (max-width: 782px) {
    .popay-pos-reports {
        padding-right: 10px;
    }
}