/**
 * Reward Redemptions Page Styles
 * Matches the ENNU Aesthetics Design System
 * 
 * @package ENNU_Checkout_Payment
 * @since 2.4.0
 */

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;500;600;700&display=swap');

/* ==========================================================================
   WRAPPER & LAYOUT
   ========================================================================== */

.ennu-reward-redemptions-wrapper {
    width: 100%;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

/* Full Width Header */
.ennu-reward-redemptions-wrapper .ennu-checkin-header-fullwidth {
    width: 100%;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%);
    padding: 20px 24px 16px;
    margin: 0;
    box-sizing: border-box;
    border-bottom: none;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
}

.ennu-reward-redemptions-wrapper .ennu-checkin-header-content {
    max-width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.ennu-reward-redemptions-wrapper .ennu-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.625rem;
    font-weight: 600;
    color: #1A2744;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.01em;
}

.ennu-reward-redemptions-wrapper .ennu-title-icon {
    font-size: 1.25rem;
}

/* Buttons */
.ennu-reward-redemptions-wrapper .ennu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}

.ennu-reward-redemptions-wrapper .ennu-btn-secondary {
    background: transparent;
    color: #1A2744;
    border-color: #D1D5DB;
}

.ennu-reward-redemptions-wrapper .ennu-btn-secondary:hover {
    background: #1A2744;
    color: #FFFFFF;
    border-color: #1A2744;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 39, 68, 0.2);
}

.ennu-reward-redemptions-wrapper .ennu-btn-secondary .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Main Container */
.ennu-reward-redemptions {
    max-width: 100%;
    margin: 0;
    padding: 0 24px 24px 24px;
    font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   STATS CARDS
   ========================================================================== */

.ennu-reward-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
    margin-top: 16px;
}

.ennu-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.ennu-stat-card.ennu-stat-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
}

.ennu-stat-card.ennu-stat-primary .ennu-stat-value,
.ennu-stat-card.ennu-stat-primary .ennu-stat-label {
    color: #fff;
}

.ennu-stat-card.ennu-stat-primary .ennu-stat-icon {
    background: rgba(255, 255, 255, 0.2);
}

.ennu-stat-card.ennu-stat-credits {
    border-left: 4px solid #10b981;
}

.ennu-stat-card.ennu-stat-debits {
    border-left: 4px solid #6366f1;
}

.ennu-stat-icon {
    font-size: 1.75rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

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

.ennu-stat-value {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a2a4a;
    line-height: 1.2;
}

.ennu-stat-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   PROGRAM STATS SECTION
   ========================================================================== */

.ennu-program-stats {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ennu-program-stats-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ennu-program-stats-title .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #6b7280;
}

.ennu-program-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.ennu-program-stat-card {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
}

.ennu-program-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ennu-program-stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ennu-program-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ennu-program-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ennu-program-stat-amounts {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ennu-program-amount {
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ennu-program-amount.credit {
    color: #059669;
}

.ennu-program-amount.debit {
    color: #6366f1;
}

.ennu-program-count {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* ==========================================================================
   FILTERS
   ========================================================================== */

.ennu-reward-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ennu-search-box {
    position: relative;
    flex: 1;
    max-width: 350px;
    min-width: 200px;
}

.ennu-search-box .dashicons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ennu-search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ennu-search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ennu-filter-group {
    min-width: 150px;
}

.ennu-date-filter {
    min-width: 140px;
}

.ennu-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ennu-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ennu-filter-info {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: auto;
}

/* ==========================================================================
   MAIN CONTENT & TABLE
   ========================================================================== */

.ennu-main {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.ennu-content {
    min-height: 400px;
}

/* Loading State */
.ennu-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.ennu-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: ennu-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* Empty State */
.ennu-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.ennu-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ennu-empty-text {
    font-size: 1.125rem;
    color: #6b7280;
    font-weight: 500;
}

.ennu-empty-subtext {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 4px;
}

/* Table */
.ennu-redemptions-table {
    width: 100%;
    border-collapse: collapse;
}

.ennu-redemptions-table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.ennu-redemptions-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.ennu-redemptions-table td {
    padding: 14px 16px;
    font-size: 0.9375rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.ennu-redemptions-table tbody tr {
    transition: background-color 0.15s ease;
}

.ennu-redemptions-table tbody tr:hover {
    background-color: #f9fafb;
}

.ennu-redemptions-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Cells */
.ennu-redemptions-table .cell-patient {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ennu-patient-name {
    font-weight: 600;
    color: #1a2744;
}

.ennu-patient-email {
    font-size: 0.8125rem;
    color: #6b7280;
}

.ennu-redemptions-table .cell-program {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ennu-program-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: #f3f4f6;
    white-space: nowrap;
}

.ennu-program-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ennu-redemptions-table .cell-type {
    text-align: center;
}

.ennu-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.ennu-type-badge.credit {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.ennu-type-badge.debit {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.ennu-redemptions-table .cell-amount {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-weight: 600;
    text-align: right;
}

.ennu-amount-credit {
    color: #059669;
}

.ennu-amount-debit {
    color: #4f46e5;
}

.ennu-balance-after {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 400;
    margin-top: 2px;
}

.ennu-redemptions-table .cell-order a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.ennu-redemptions-table .cell-order a:hover {
    text-decoration: underline;
}

.ennu-redemptions-table .cell-note {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #6b7280;
    font-size: 0.875rem;
}

.ennu-redemptions-table .cell-staff {
    color: #6b7280;
    font-size: 0.875rem;
}

.ennu-redemptions-table .cell-date {
    white-space: nowrap;
    font-size: 0.8125rem;
    color: #6b7280;
}

.ennu-date-time {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .ennu-reward-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ennu-search-box {
        max-width: 100%;
    }
    
    .ennu-filter-info {
        margin-left: 0;
        text-align: center;
    }
    
    .ennu-redemptions-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .ennu-reward-redemptions-wrapper .ennu-checkin-header-fullwidth {
        padding: 16px;
    }
    
    .ennu-reward-redemptions-wrapper .ennu-title {
        font-size: 1.375rem;
    }
    
    .ennu-reward-redemptions {
        padding: 0 16px 16px 16px;
    }
    
    .ennu-reward-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ennu-stat-card {
        padding: 14px;
    }
    
    .ennu-stat-value {
        font-size: 1.125rem;
    }
    
    .ennu-program-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ennu-reward-stats {
        grid-template-columns: 1fr;
    }
    
    .ennu-program-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ennu-checkin-header-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ==========================================================================
   NOTICE STYLES
   ========================================================================== */

.ennu-notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9375rem;
}

.ennu-notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.ennu-notice-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.ennu-notice-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
