/**
 * evo-loyalty Progress Bar - hs-modern Specific Styles
 * 
 * This CSS is ONLY loaded when hs-modern-cart-checkout plugin is active
 * Fallback: frontend-loyalty.css (for WC Blocks / Classic)
 * 
 * @package EvoLoyalty
 * @since 2.5.0 (hs-modern Integration)
 */

/* ===== Container in hs-modern Cart Sidebar ===== */
.hs-cart__summary [data-evo-loyalty-progress-bar="container"] {
    margin: 20px 0;
    padding: 0;
    background: transparent;
}

/* ===== Progress Bar Grid ===== */
.hs-cart .evo-loyalty-progress-bar__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

/* ===== Column Styling (inherit from hs-modern) ===== */
.hs-cart .evo-loyalty-progress-bar__column {
    background: var(--hs-bg-secondary, #f9f9f9);
    border: 1px solid var(--hs-border-color, #ddd);
    border-radius: var(--hs-border-radius, 4px);
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.hs-cart .evo-loyalty-progress-bar__column:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hs-cart .evo-loyalty-progress-bar__column--highlighted {
    background: var(--hs-accent-bg, #fff8e1);
    border-color: var(--hs-accent-border, #ffd700);
    border-width: 2px;
}

.hs-cart .evo-loyalty-progress-bar__column--next-tier {
    background: var(--hs-primary-bg, #e3f2fd);
    border-color: var(--hs-primary-border, #2196f3);
    border-width: 2px;
}

/* ===== Typography (match hs-modern) ===== */
.hs-cart .evo-loyalty-progress-bar__label {
    font-size: var(--hs-font-size-sm, 12px);
    color: var(--hs-text-muted, #666);
    margin-bottom: 5px;
    line-height: 1.4;
}

.hs-cart .evo-loyalty-progress-bar__value {
    font-size: var(--hs-font-size-lg, 24px);
    font-weight: var(--hs-font-weight-bold, 700);
    color: var(--hs-text-primary, #333);
    line-height: 1.2;
}

.hs-cart .evo-loyalty-progress-bar__unit {
    font-size: var(--hs-font-size-base, 16px);
    font-weight: var(--hs-font-weight-normal, 400);
}

.hs-cart .evo-loyalty-progress-bar__meta {
    font-size: var(--hs-font-size-xs, 11px);
    color: var(--hs-text-muted, #999);
    margin-top: 5px;
}

/* ===== Current Cart Discount Row ===== */
.hs-cart .evo-loyalty-cart-discount {
    background: var(--hs-success-bg, #e8f5e9);
    border-left: 4px solid var(--hs-success-border, #4caf50);
    padding: 12px 15px;
    border-radius: var(--hs-border-radius, 4px);
    margin: 15px 0;
    text-align: center;
}

.hs-cart .evo-loyalty-cart-discount__value {
    font-size: var(--hs-font-size-lg, 18px);
    font-weight: var(--hs-font-weight-semibold, 600);
    color: var(--hs-success-text, #2e7d32);
}

.hs-cart .evo-loyalty-cart-discount__percentage {
    font-size: var(--hs-font-size-xl, 24px);
    font-weight: var(--hs-font-weight-bold, 700);
}

/* ===== Mobile Summary ===== */
.hs-cart .evo-loyalty-progress-bar__mobile-summary {
    display: none; /* Hidden on Desktop */
    background: var(--hs-info-bg, #e3f2fd);
    border-left: 4px solid var(--hs-info-border, #2196f3);
    padding: 12px 15px;
    border-radius: var(--hs-border-radius, 4px);
    margin: 15px 0;
}

/* FEATURE_016: Hide mobile_summary when not virtually enrolled */
.hs-cart .evo-loyalty-progress-bar__mobile-summary--hidden {
    display: none !important;
}

.hs-cart .evo-loyalty-progress-bar__mobile-summary__title {
    font-weight: var(--hs-font-weight-semibold, 600);
    font-size: var(--hs-font-size-base, 14px);
    margin-bottom: 5px;
    color: var(--hs-text-primary, #333);
}

.hs-cart .evo-loyalty-progress-bar__mobile-summary__text {
    font-size: var(--hs-font-size-base, 14px);
    color: var(--hs-text-secondary, #666);
}

/* ===== Progress Bar Visual ===== */
.hs-cart .evo-loyalty-progress-bar__bar-container {
    width: 100%;
    height: 8px;
    background: var(--hs-bg-tertiary, #e0e0e0);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.hs-cart .evo-loyalty-progress-bar__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--hs-primary-color, #2196f3) 0%, 
        var(--hs-accent-color, #ffd700) 100%
    );
    transition: width 0.5s ease;
}

/* ===== Integration with hs-cart-sum (Totals) ===== */
.hs-cart-sum + [data-evo-loyalty-progress-bar] {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--hs-border-color, #ddd);
}

/* Alternative: BEFORE hs-cart-sum */
[data-evo-loyalty-progress-bar] + .hs-cart-sum {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--hs-border-color, #ddd);
}

/* ===== DEV-OUTPUT Block (Details) ===== */
.hs-cart .evo-loyalty-points-breakdown-details {
    margin: 15px 0;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.hs-cart .evo-loyalty-points-breakdown-details summary {
    cursor: pointer;
    padding: 10px 15px;
    font-weight: 600;
    user-select: none;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    transition: background 0.2s ease;
}

.hs-cart .evo-loyalty-points-breakdown-details summary:hover {
    background: #ebebeb;
}

.hs-cart .evo-loyalty-points-breakdown-details[open] summary {
    border-bottom: 1px solid #ddd;
}

.hs-cart .evo-breakdown-content {
    padding: 15px;
}

/* ===== Cache Status Section ===== */
.hs-cart .evo-loyalty-cache-status-section {
    margin: 15px 0;
    padding: 15px;
    background: #fff9e6;
    border: 1px solid #ffd700;
    border-radius: 4px;
}

.hs-cart .evo-loyalty-cache-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.hs-cart .evo-loyalty-cache-table td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

/* ===== Responsive Breakpoints (match hs-modern) ===== */
@media (max-width: 1024px) {
    .hs-cart .evo-loyalty-progress-bar__grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablets */
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .hs-cart .evo-loyalty-progress-bar__grid {
        display: none; /* Hide grid on mobile */
    }
    
    .hs-cart .evo-loyalty-progress-bar__mobile-summary {
        display: block; /* Show mobile summary */
    }
    
    .hs-cart .evo-loyalty-cart-discount {
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hs-cart .evo-loyalty-progress-bar__mobile-summary {
        padding: 10px;
        font-size: 13px;
    }
    
    .hs-cart .evo-loyalty-cart-discount__value {
        font-size: 16px;
    }
}

/* ========================================
   FEATURE_016 TODO_011: DEV-OUTPUT MODAL STYLES
   ======================================== */

/* Modal Container */
.evo-dev-output-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999; /* Höher als Debug-Bar (9999) */
    display: none; /* Hidden by default, shown via JavaScript */
}

/* Semi-transparent Overlay (backdrop) */
.evo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.2s ease;
}

/* Modal Content Box (white container) */
.evo-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    margin: 2vh auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

/* Modal Header (gradient background) */
.evo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 3px solid #5568d3;
}

.evo-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

/* Close Button (×) */
.evo-modal-close {
    background: transparent;
    border: 2px solid white;
    color: white;
    font-size: 28px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.evo-modal-close:hover {
    background: white;
    color: #667eea;
    transform: rotate(90deg);
}

/* Modal Body (scrollable content area) */
.evo-modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(90vh - 80px); /* Subtract header height */
    background: #f9f9f9;
}

/* Loading Spinner */
.evo-loading-spinner {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.evo-loading-spinner span {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Debug-Bar Button Styles */
.evo-dev-output-btn {
    transition: all 0.2s ease;
}

.evo-dev-output-btn:hover {
    background: #135e96 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.evo-dev-output-btn:active {
    transform: translateY(0);
}

/* Preserve existing DEV-OUTPUT table styles inside modal */
.evo-modal-body .points-breakdown-table,
.evo-modal-body .points-summary-table,
.evo-modal-body .cost-breakdown-table,
.evo-modal-body .cost-summary-table,
.evo-modal-body .discount-info-table,
.evo-modal-body .evo-loyalty-cache-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
}

.evo-modal-body table th,
.evo-modal-body table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.evo-modal-body table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.evo-modal-body table tr:hover {
    background-color: #f0f0f0;
}

/* DEV-OUTPUT specific elements inside modal */
.evo-modal-body .evo-loyalty-points-breakdown-details {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 0 0 20px 0;
}

.evo-modal-body .evo-loyalty-cache-status-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0 0 0;
}

.evo-modal-body .evo-loyalty-clear-cache-actions {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive: Mobile Adjustments */
@media (max-width: 768px) {
    .evo-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 1vh auto;
    }
    
    .evo-modal-header {
        padding: 15px;
    }
    
    .evo-modal-header h2 {
        font-size: 16px;
    }
    
    .evo-modal-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    .evo-modal-body {
        padding: 15px;
        max-height: calc(95vh - 60px);
    }
    
    /* Make tables scrollable on mobile */
    .evo-modal-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Print: Hide Modal */
@media print {
    .evo-dev-output-modal {
        display: none !important;
    }
}

/* ===== Print Styles (hide on print) ===== */
@media print {
    [data-evo-loyalty-progress-bar] {
        display: none !important;
    }
}
