/**
 * Payment Reconciliation Frontend Dashboard Styles
 *
 * Luxury design system for front-end shortcode dashboard.
 *
 * @package ENNU\PaymentReconciliation
 * @since 1.0.0
 */

/* Reset for shortcode container */
.ennu-pr-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a2e;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0;
}

.ennu-pr-dashboard *,
.ennu-pr-dashboard *::before,
.ennu-pr-dashboard *::after {
    box-sizing: border-box;
}

/* Notices */
.ennu-pr-notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ennu-pr-notice--warning {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffc107;
    color: #856404;
}

.ennu-pr-notice--error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #f44336;
    color: #c62828;
}

.ennu-pr-notice--success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #4caf50;
    color: #2e7d32;
}

/* Stats Cards */
.ennu-pr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ennu-pr-stat {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ennu-pr-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.ennu-pr-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ennu-pr-stat--pending .ennu-pr-stat-icon { background: #fff8e1; color: #f9a825; }
.ennu-pr-stat--matched .ennu-pr-stat-icon { background: #e8f5e9; color: #43a047; }
.ennu-pr-stat--synced .ennu-pr-stat-icon { background: #e3f2fd; color: #1976d2; }
.ennu-pr-stat--failed .ennu-pr-stat-icon { background: #ffebee; color: #e53935; }
.ennu-pr-stat--amount .ennu-pr-stat-icon { background: #f3e5f5; color: #8e24aa; }

.ennu-pr-stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ennu-pr-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.ennu-pr-stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Filters */
.ennu-pr-filters {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    justify-content: space-between;
}

.ennu-pr-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    flex: 1;
}

.ennu-pr-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ennu-pr-filter label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ennu-pr-filter input[type="date"],
.ennu-pr-filter select {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    min-width: 130px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ennu-pr-filter input[type="date"]:focus,
.ennu-pr-filter select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.ennu-pr-filter-actions {
    display: flex;
    gap: 8px;
}

.ennu-pr-scan-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.ennu-pr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ennu-pr-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.ennu-pr-btn--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

.ennu-pr-btn--primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ennu-pr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Bulk Actions */
.ennu-pr-bulk-actions {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #64b5f6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ennu-pr-selected-count {
    font-weight: 600;
    color: #1565c0;
    margin-right: auto;
}

/* Table */
.ennu-pr-table-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

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

.ennu-pr-table th {
    background: #f8f9fa;
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e8e8e8;
}

.ennu-pr-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.ennu-pr-table tbody tr:hover {
    background: #f8f9fa;
}

.ennu-pr-table tbody tr.ennu-pr-row--synced {
    background: #f1f8e9;
}

.ennu-pr-table tbody tr.ennu-pr-row--synced:hover {
    background: #e8f5e9;
}

/* Table Columns */
.ennu-pr-col-cb {
    width: 40px;
    text-align: center;
}

.ennu-pr-col-order {
    min-width: 100px;
}

.ennu-pr-col-order strong {
    color: #1a1a2e;
}

.ennu-pr-col-type {
    width: 100px;
}

.ennu-pr-col-date {
    width: 90px;
}

.ennu-pr-col-date small {
    display: block;
    color: #888;
    font-size: 11px;
    margin-top: 2px;
}

.ennu-pr-col-amount {
    width: 100px;
    font-weight: 600;
    color: #1a1a2e;
}

.ennu-pr-col-customer {
    min-width: 150px;
}

.ennu-pr-col-customer small {
    display: block;
    color: #888;
    font-size: 12px;
    margin-top: 2px;
    word-break: break-word;
}

.ennu-pr-col-patient {
    width: 110px;
}

.ennu-pr-col-status {
    width: 90px;
}

.ennu-pr-col-actions {
    width: 120px;
    text-align: center;
}

.ennu-pr-icon {
    font-size: 12px;
    margin-left: 4px;
}

.ennu-pr-empty {
    text-align: center;
    padding: 60px 20px !important;
    color: #888;
}

/* Checkboxes */
.ennu-pr-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

/* Badges */
.ennu-pr-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ennu-pr-badge--purple { background: #f3e5f5; color: #7b1fa2; }
.ennu-pr-badge--blue { background: #e3f2fd; color: #1565c0; }
.ennu-pr-badge--orange { background: #fff3e0; color: #e65100; }
.ennu-pr-badge--teal { background: #e0f2f1; color: #00695c; }
.ennu-pr-badge--gray { background: #eceff1; color: #546e7a; }
.ennu-pr-badge--green { background: #e8f5e9; color: #2e7d32; }
.ennu-pr-badge--yellow { background: #fff8e1; color: #f57f17; }
.ennu-pr-badge--red { background: #ffebee; color: #c62828; }

/* Action Buttons */
.ennu-pr-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.ennu-pr-action-btn:hover {
    background: #f5f5f5;
    color: #1a1a2e;
    border-color: #ccc;
}

.ennu-pr-action-btn--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

.ennu-pr-action-btn--primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.ennu-pr-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pagination */
.ennu-pr-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e8e8e8;
    background: #f8f9fa;
}

.ennu-pr-page-info {
    font-size: 13px;
    color: #666;
}

.ennu-pr-page-links {
    display: flex;
    gap: 8px;
}

/* Modal */
.ennu-pr-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ennu-pr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.ennu-pr-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ennu-pr-modal-in 0.3s ease;
}

@keyframes ennu-pr-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ennu-pr-modal-close {
    position: absolute;
    right: 16px;
    top: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ennu-pr-modal-close:hover {
    background: #e0e0e0;
    color: #1a1a2e;
}

.ennu-pr-modal-title {
    margin: 0;
    padding: 20px 24px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e8e8e8;
}

.ennu-pr-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Loading */
.ennu-pr-loading {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.ennu-pr-loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: ennu-pr-spin 0.8s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

@keyframes ennu-pr-spin {
    to { transform: rotate(360deg); }
}

/* Details Grid */
.ennu-pr-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.ennu-pr-details-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
}

.ennu-pr-details-section--full {
    grid-column: 1 / -1;
}

.ennu-pr-details-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.ennu-pr-details-table {
    width: 100%;
    border-collapse: collapse;
}

.ennu-pr-details-table th,
.ennu-pr-details-table td {
    padding: 8px 0;
    text-align: left;
    font-size: 13px;
    border: none;
}

.ennu-pr-details-table th {
    font-weight: 600;
    color: #666;
    width: 40%;
}

.ennu-pr-details-table td {
    color: #1a1a2e;
}

/* Syncing States */
.ennu-pr-table tbody tr.ennu-pr-syncing {
    background: #e3f2fd;
    opacity: 0.8;
}

.ennu-pr-table tbody tr.ennu-pr-sync-success {
    background: #c8e6c9;
}

.ennu-pr-table tbody tr.ennu-pr-sync-error {
    background: #ffcdd2;
}

/* Toast Notifications */
.ennu-pr-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999999;
    padding: 16px 24px;
    border-radius: 10px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: ennu-pr-toast-in 0.3s ease;
    max-width: 400px;
}

@keyframes ennu-pr-toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ennu-pr-toast--success {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    color: #fff;
}

.ennu-pr-toast--error {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    color: #fff;
}

.ennu-pr-toast--warning {
    background: linear-gradient(135deg, #ffa726 0%, #f57c00 100%);
    color: #fff;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .ennu-pr-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .ennu-pr-col-customer {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .ennu-pr-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ennu-pr-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .ennu-pr-filters-form {
        flex-direction: column;
    }

    .ennu-pr-filter input[type="date"],
    .ennu-pr-filter select {
        width: 100%;
    }

    .ennu-pr-scan-actions {
        justify-content: stretch;
    }

    .ennu-pr-scan-actions .ennu-pr-btn {
        flex: 1;
        justify-content: center;
    }

    .ennu-pr-details-grid {
        grid-template-columns: 1fr;
    }

    .ennu-pr-table {
        font-size: 12px;
    }

    .ennu-pr-col-type,
    .ennu-pr-col-patient {
        display: none;
    }

    .ennu-pr-bulk-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .ennu-pr-selected-count {
        margin-right: 0;
        margin-bottom: 12px;
    }
}

@media screen and (max-width: 480px) {
    .ennu-pr-stats {
        grid-template-columns: 1fr;
    }

    .ennu-pr-col-date,
    .ennu-pr-col-status {
        display: none;
    }

    .ennu-pr-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
}
