/**
 * Vouchers.css - Styles for voucher list component
 */

/* Voucher Container */
.vouchers-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 20px 0;
}

.vouchers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.vouchers-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.vouchers-count {
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 15px;
}

/* Voucher Container Layouts */
.vouchers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Desktop: Vertical scroll, max 3 items visible */
@media (min-width: 769px) {
    .vouchers-container {
        max-height: 300px; /* ~3 items x 100px each */
    }
}

/* Mobile: Horizontal scroll */
@media (max-width: 768px) {
    .vouchers-container {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 10px;
        gap: 15px;
    }
    
    .voucher-item {
        min-width: 280px;
        flex-shrink: 0;
    }
}

/* Individual Voucher Item */
.voucher-item {
    display: flex;
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 112px !important;
}

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

.voucher-item.voucher-expanded {
    border-color: #007bff;
}

/* Voucher Types */
.voucher-freeship {
    /* background: linear-gradient(135deg, #0db88b, #09c28b); */
    color: white;
}
.voucher-freeship .voucher-icon {
    background-image: url('/static/img/bg-ship-vouchers.png') !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
.voucher-freeship .voucher-icon img {
    width: 50px !important;
    border-radius: 100px
}
.voucher-freeship .voucher-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    margin: 8px;
    border-radius: 8px;
    padding: 0px;
}

.voucher-vip {
    /* background: linear-gradient(135deg, #6f42c1, #e83e8c); */
    color: white;
}

.voucher-vip .voucher-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    margin: 8px;
    border-radius: 8px;
    padding: 12px;
}

.voucher-discount {
    /* background: linear-gradient(135deg, #ff1b7e, #ffc107); */
    color: white;
}
.voucher-discount .voucher-icon {
    background-image: url('/static/img/bg-vouchers.png') !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
.voucher-discount .voucher-icon img {
    width: 50px !important;
    border-radius: 100px
}
.voucher-discount .voucher-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    margin: 8px;
    border-radius: 5px;
    padding: 0px;
    width: calc(100% - 112px);
}

/* Voucher Badge */
.voucher-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.badge-text {
    background: rgba(255, 165, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Voucher Icon */
.voucher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
}
.voucher-icon img {
    width: 112px;
}
.icon-freeship,
.icon-vip,
.icon-discount {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: white;
}

.icon-freeship svg,
.icon-vip svg,
.icon-discount svg {
    width: 28px;
    height: 28px;
}

.icon-freeship span {
    font-size: 12px;
    font-weight: 600;
}

/* Voucher Content */
.voucher-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.voucher-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #333;
}

.voucher-subtitle {
    font-size: 10px;
    color: #666;
    margin-bottom: 3px;
    line-height: 1.4;
}

/* Progress Bar */
.voucher-progress {
    margin: 2px 0;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Voucher Footer */
.voucher-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.voucher-expiry {
    font-size: 12px;
    color: #666;
}

.voucher-expiry span:first-child {
    font-weight: 500;
}

.voucher-expiry span:last-child {
    font-weight: 600;
    color: #333;
}

/* Use Button */
.voucher-use-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.voucher-use-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.voucher-use-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Loading States */
.vouchers-loading,
.vouchers-empty,
.vouchers-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.vouchers-loading {
    background: #f8f9fa;
    border-radius: 8px;
}

.vouchers-empty {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
}

.vouchers-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
}

/* Custom Toast Notifications */
.voucher-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.voucher-toast.voucher-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.voucher-toast-success {
    border-left: 4px solid #28a745;
}

.voucher-toast-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.voucher-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.voucher-toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

/* Stacking multiple toasts */
.voucher-toast:nth-of-type(1) { top: 20px; }
.voucher-toast:nth-of-type(2) { top: 90px; }
.voucher-toast:nth-of-type(3) { top: 160px; }

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbar Styling */
.vouchers-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.vouchers-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.vouchers-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.vouchers-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .vouchers-wrapper {
        margin: 15px 0;
    }
    
    .vouchers-title {
        font-size: 16px;
    }
    
    .voucher-item {
        min-width: 250px;
    }
    
    
    .icon-freeship svg,
    .icon-vip svg,
    .icon-discount svg {
        width: 24px;
        height: 24px;
    }
    
    .voucher-title {
        font-size: 14px;
    }
    
    .voucher-subtitle {
        font-size: 12px;
    }
}

/* Animation for voucher items */
.voucher-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.voucher-item:nth-child(1) { animation-delay: 0.1s; }
.voucher-item:nth-child(2) { animation-delay: 0.2s; }
.voucher-item:nth-child(3) { animation-delay: 0.3s; }
.voucher-item:nth-child(4) { animation-delay: 0.4s; }
.voucher-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 