/**
 * Vouchers Styles for Uniturm
 * Adapted from WordPress plugin
 */

/* Container */
.vouchers-container {
    max-width: 75rem;
    margin: 0 auto 2rem auto;
}

.vouchers-shop-header {
    margin-bottom: 1.875rem;
    text-align: center;
}

.vouchers-shop-header h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0 0 0.625rem 0;
}

/* Section Headers */
.vouchers-section {
    margin-bottom: 2.5rem;
}

.vouchers-section h3 {
    font-size: 1.5rem;
    color: #34495e;
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 0.125rem solid #e0e0e0;
}

/* Voucher List */
.vouchers-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Voucher Item */
.voucher-item {
    background: white;
    border: 0.0625rem solid #ddd;
    border-radius: 0.5rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.08);
}

.voucher-item:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.12);
}

.voucher-item.voucher-expired {
    opacity: 0.65;
    background: #f8f9fa;
}

/* Voucher Content */
.voucher-content {
    flex: 1;
    margin-bottom: 1rem;
}

.voucher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.9375rem;
    gap: 0.625rem;
}

.voucher-title {
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    flex: 1;
}

.voucher-value {
    background: #28a745;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 1.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.voucher-excerpt {
    font-size: 0.9375rem;
    color: #555;
    margin-bottom: 0.9375rem;
    line-height: 1.6;
}

.voucher-meta {
    margin: 0.625rem 0;
    font-size: 0.875rem;
    color: #666;
}

.voucher-valid-until {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e8f5e9;
    border-radius: 0.25rem;
    color: #2e7d32;
    font-weight: 500;
}

.voucher-valid-until.expired {
    background: #ffebee;
    color: #c62828;
}

.voucher-terms {
    font-size: 0.8125rem;
    color: #666;
    padding: 0;
    margin-top: 0.625rem;
    line-height: 1.5;
}

.voucher-terms strong {
    display: block;
    margin-bottom: 0.3125rem;
    color: #333;
}

/* Actions */
.voucher-actions {
    /* text-align: center; */
}

.voucher-redeem-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #4f9f10;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
}

.voucher-redeem-btn:hover {
    background-color: #5eb319;
    color: #356f05;
}

.voucher-redeem-btn:active {
    background-color: #8eba0f;
}

.voucher-expired .voucher-redeem-btn {
    background: #6c757d;
    cursor: not-allowed;
    pointer-events: none;
}

/* Empty State */
.vouchers-empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
    font-size: 1rem;
    color: #999;
    font-style: italic;
}

/* Error State */
.voucher-error {
    background: #ffebee;
    color: #c62828;
    padding: 0.9375rem 1.25rem;
    border-radius: 0.375rem;
    border-left: 0.25rem solid #c62828;
    margin: 1.25rem 0;
}

/* Expired Section */
.vouchers-expired {
    opacity: 0.85;
}

.vouchers-expired h3 {
    color: #6c757d;
}

/* Loading State */
.vouchers-loading {
    text-align: center;
    padding: 2.5rem;
}

.vouchers-loading::after {
    content: '';
    display: inline-block;
    width: 1.875rem;
    height: 1.875rem;
    border: 0.1875rem solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Compact Layout */
.voucher-item-compact {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.625rem 0;
    box-shadow: none;
    border-bottom: 0.0625rem solid #e0e0e0;
}

.voucher-item-compact:hover {
    transform: none;
    box-shadow: none;
}

.voucher-item-compact:last-child {
    border-bottom: none;
}

/* Overlay */
.voucher-overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
}

.voucher-overlay-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 0.5rem;
    padding: 1.875rem;
    max-width: 31.25rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.3);
    z-index: 9999;
    box-sizing: border-box;
}

.voucher-overlay-close {
    position: absolute;
    top: 0.9375rem;
    right: 0.9375rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.voucher-overlay-close:hover {
    color: #333;
}

.voucher-overlay-content h2 {
    font-size: 1.5rem;
    margin: 0 0 1.25rem 0;
    color: #2c3e50;
    padding-right: 2rem;
}

.voucher-overlay-code-section {
    background: #f8f9fa;
    border: 0.125rem dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 1.25rem;
    margin: 1.25rem 0;
    text-align: center;
}

.voucher-overlay-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.625rem;
}

.voucher-overlay-code {
    font-size: 1.75rem;
    font-weight: bold;
    color: #28a745;
    letter-spacing: 0.125rem;
    margin: 0.625rem 0;
    font-family: 'Courier New', monospace;
}

.voucher-overlay-no-code {
    font-size: 1rem;
    color: #6c757d;
    font-style: italic;
}

.voucher-overlay-copy {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-top: 0.625rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.voucher-overlay-copy:hover {
    background: #5a6268;
    color: white;
}

.voucher-overlay-terms {
    margin: 1.25rem 0;
    padding: 0.9375rem;
    background: #fff9e6;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #666;
}

.voucher-overlay-terms strong {
    color: #856404;
    display: block;
    margin-bottom: 0.3125rem;
}

.voucher-overlay-valid {
    text-align: center;
    margin: 0.9375rem 0;
    font-size: 0.875rem;
    color: #6c757d;
}

.voucher-overlay-shop {
    display: block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: 0;
    background-color: #b0e613;
    color: #293508 !important;
    text-align: center;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s ease;
    box-sizing: border-box;
    border: none;
}

.voucher-overlay-shop:hover {
    background-color: #9fce11;
    color: #293508 !important;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 48rem) {
    .vouchers-container {
        padding: 0 0.625rem;
    }

    .voucher-item {
        padding: 1rem;
    }

    .voucher-title {
        font-size: 1rem;
    }

    .voucher-header {
        flex-direction: column;
        gap: 0.625rem;
    }

    .voucher-value {
        align-self: flex-start;
    }

    .voucher-redeem-btn {
        width: 100%;
        display: block;
    }

    .voucher-overlay-container {
        padding: 1.25rem;
    }

    .voucher-overlay-code {
        font-size: 1.375rem;
    }
}
