/**
 * ZHF Gifts - Gift Progress Modal & Button Styles
 * 
 * Styles for the client-side gift progress modal and floating button
 */

/* =======================
   FLOATING GIFT BUTTON
   ======================= */

.zhf-gift-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.zhf-gift-button button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    min-width: 120px;
    justify-content: center;
}

.zhf-gift-button button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, #ee5a24, #ff6b6b);
}

.zhf-gift-button button:active {
    transform: translateY(0);
}

.zhf-gift-icon {
    font-size: 18px;
    animation: bounce 2s infinite;
}

.zhf-gift-text {
    font-size: 13px;
    letter-spacing: 0.5px;
}

.zhf-gift-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #27ae60;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse 1.5s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* =======================
   MODAL BASE STYLES
   ======================= */

.zhf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.zhf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.zhf-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* =======================
   MODAL HEADER
   ======================= */

.zhf-modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.zhf-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="gift-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><text x="10" y="15" text-anchor="middle" font-size="12" fill="rgba(255,255,255,0.1)">🎁</text></pattern></defs><rect width="100" height="100" fill="url(%23gift-pattern)"/></svg>');
    opacity: 0.3;
}

.zhf-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.zhf-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.zhf-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* =======================
   MODAL BODY
   ======================= */

.zhf-modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.zhf-cart-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.zhf-cart-info {
    margin: 0;
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.4;
}

.zhf-cart-info a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.zhf-cart-info a:hover {
    text-decoration: underline;
}

.zhf-modal-intro {
    text-align: center;
    font-size: 16px;
    color: #fff;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

/* =======================
   GIFT RULES LIST
   ======================= */

.zhf-gift-rules-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.zhf-gift-rule-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.zhf-gift-rule-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.zhf-gift-rule-item:hover::before {
    left: 100%;
}

.zhf-gift-rule-item.qualified {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #27ae60;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2);
}

.zhf-gift-product {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.zhf-gift-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.zhf-gift-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zhf-gift-details {
    flex: 1;
}

.zhf-gift-name {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.zhf-gift-condition {
    margin: 0;
    font-size: 14px;
    color: #fff;
    line-height: 1.4;
}

.zhf-gift-qualified {
    flex-shrink: 0;
}

.zhf-qualified-badge {
    background: #27ae60;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    animation: celebrate 0.6s ease;
}

@keyframes celebrate {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* =======================
   PROGRESS BAR STYLES
   ======================= */

.zhf-gift-progress {
    margin-bottom: 15px;
}

.zhf-status-indicator {
    text-align: center;
    margin-bottom: 12px;
}

.zhf-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid;
    text-transform: none;
}

.zhf-status.qualified {
    background: #d4edda;
    color: #155724;
    border-color: #27ae60;
}

.zhf-status.in-progress {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #3498db;
}

.zhf-progress-bar {
    height: 12px;
    background: #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.zhf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 6px;
    transition: width 0.8s ease;
    position: relative;
}

.zhf-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.zhf-progress-fill.completed {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    animation: completedPulse 1.5s ease-in-out;
}

@keyframes completedPulse {
    0% { background: linear-gradient(90deg, #3498db, #2980b9); }
    100% { background: linear-gradient(90deg, #27ae60, #2ecc71); }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.zhf-progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-top: 8px;
}

.zhf-progress-current {
    color: #2c3e50;
    font-weight: 600;
}

.zhf-progress-target {
    color: #fff;
    font-weight: 500;
}

.zhf-gift-remaining {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.zhf-gift-remaining p {
    margin: 0;
    font-size: 13px;
    color: #856404;
    font-weight: 500;
    text-align: center;
}

/* =======================
   MODAL FOOTER
   ======================= */

.zhf-modal-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.zhf-modal-note {
    text-align: center;
    font-size: 12px;
    color: #95a5a6;
    margin: 0;
    line-height: 1.4;
}

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

@media (max-width: 768px) {
    .zhf-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 15px;
    }
    
    .zhf-modal-header {
        padding: 20px;
    }
    
    .zhf-modal-header h3 {
        font-size: 20px;
    }
    
    .zhf-modal-body {
        padding: 20px;
    }
    
    .zhf-cart-summary {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .zhf-cart-info {
        font-size: 13px;
    }
    
    .zhf-gift-rule-item {
        padding: 20px;
    }
    
    .zhf-gift-product {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .zhf-gift-image {
        width: 50px;
        height: 50px;
    }
    
    .zhf-gift-name {
        font-size: 16px;
    }
    
    .zhf-gift-button {
        bottom: 15px;
        left: 15px;
    }
    
    .zhf-gift-button button {
        padding: 10px 16px;
        font-size: 12px;
        min-width: 100px;
    }
    
    .zhf-gift-text {
        font-size: 11px;
    }
    
    .zhf-progress-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .zhf-gift-button button {
        padding: 8px 12px;
        min-width: 80px;
    }
    
    .zhf-gift-icon {
        font-size: 16px;
    }
    
    .zhf-gift-text {
        display: none;
    }
    
    .zhf-modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .zhf-modal-header {
        padding: 15px;
    }
    
    .zhf-modal-body {
        padding: 15px;
    }
}

/* =======================
   ACCESSIBILITY & PRINT
   ======================= */

.zhf-modal-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.zhf-gift-button button:focus {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
}

@media print {
    .zhf-gift-button,
    .zhf-modal {
        display: none !important;
    }
}

/* =======================
   DARK MODE SUPPORT
   ======================= */

@media (prefers-color-scheme: dark) {
    .zhf-modal-content {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .zhf-gift-rule-item {
        background: #34495e;
    }
    
    .zhf-gift-rule-item.qualified {
        background: linear-gradient(135deg, #1e3a32, #27ae60);
    }
    
    .zhf-gift-name {
        color: #ecf0f1;
    }
    
    .zhf-gift-condition {
        color: #fff;
    }
    
    .zhf-progress-current {
        color: #ecf0f1;
    }
    
    .zhf-progress-bar {
        background: #ecf0f1;
    }
    
    .zhf-gift-remaining {
        background: #f39c12;
        border-color: #e67e22;
        color: #2c3e50;
    }
    
    .zhf-modal-note {
        color: #7f8c8d;
    }
}
