/* =====================================
   MODERN SHOPIFY-STYLE POPUP (LIGHT MODE)
   ===================================== */

.hive-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hive-popup-overlay.hive-popup-showing {
    opacity: 1;
    visibility: visible;
}

.hive-popup-overlay.hive-popup-hiding {
    opacity: 0;
    visibility: hidden;
}

.hive-popup-container {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 67, 255, 0.08);
}

.hive-popup-container.hive-popup-animate-in {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.hive-popup-container.hive-popup-animate-out {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
}

.hive-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100000;
    padding: 4px;
    border-radius: 6px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.hive-popup-close:hover {
    color: #374151;
    transform: scale(1.1);
    background: rgba(107, 114, 128, 0.1);
}

.hive-popup-close:focus {
    color: #374151;
    background: rgba(107, 114, 128, 0.15);
    box-shadow: 0 0 0 2px #0043FF;
}

.hive-popup-close:active {
    transform: scale(0.95);
    background: rgba(107, 114, 128, 0.2);
}

.hive-popup-content {
    padding: 48px 32px 24px;
    text-align: center;
}

.hive-popup-icon-container {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.hive-popup-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: hive-icon-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hive-popup-icon.hive-icon-success-animate {
    animation: hive-success-pulse 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hive-popup-icon.hive-icon-error-animate {
    animation: hive-error-shake 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes hive-icon-bounce {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes hive-success-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    30% {
        transform: scale(1.15);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes hive-error-shake {
    0%, 100% {
        transform: translateX(0) scale(1);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px) scale(1.02);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(4px) scale(1.02);
    }
}

.hive-popup-title {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.3;
}

.hive-popup-message {
    margin: 0 0 32px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #64748b !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hive-popup-countdown {
    margin: 16px 0 0 0;
    font-size: 12px;
    color: #94a3b8 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    opacity: 0.8;
}

.hive-popup-countdown-number {
    font-weight: 600;
    color: #0043FF !important;
}

.hive-popup-actions {
    padding: 0 32px 32px;
    display: flex;
    justify-content: center;
}

.hive-popup-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    min-height: 52px;
    text-align: center;
}

.hive-popup-btn-primary {
    background: #0043FF;
    color: white !important;
    padding: 16px 32px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0, 67, 255, 0.24);
}

.hive-popup-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.hive-popup-btn-primary:hover::before {
    left: 100%;
}

.hive-popup-btn-primary:hover {
    background: #0037d9 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 67, 255, 0.32);
}

.hive-popup-btn-primary:active {
    transform: translateY(0);
}

.hive-popup-btn-primary svg {
    flex-shrink: 0;
}

/* Success state styling */
.hive-popup-overlay.hive-popup-success .hive-popup-container {
    border-top: 4px solid #10B981;
}

.hive-popup-overlay.hive-popup-success .hive-popup-title {
    color: #059669 !important;
}

/* Error state styling */
.hive-popup-overlay.hive-popup-error .hive-popup-container {
    border-top: 4px solid #EF4444;
}

.hive-popup-overlay.hive-popup-error .hive-popup-title {
    color: #DC2626 !important;
}

.hive-popup-overlay.hive-popup-error .hive-popup-btn-primary {
    background: #6B7280;
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.24);
}

.hive-popup-overlay.hive-popup-error .hive-popup-btn-primary:hover {
    background: #4B5563;
    box-shadow: 0 8px 24px rgba(107, 114, 128, 0.32);
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .hive-popup-overlay {
        padding: 16px;
        align-items: flex-end;
    }
    
    .hive-popup-container {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        animation: none;
    }
    
    .hive-popup-container.hive-popup-animate-in {
        transform: translateY(0);
    }
    
    .hive-popup-container.hive-popup-animate-out {
        transform: translateY(100%);
    }
    
    .hive-popup-content {
        padding: 32px 24px 20px;
    }
    
    .hive-popup-actions {
        padding: 0 24px 24px;
    }
    
    .hive-popup-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
    
    .hive-popup-title {
        font-size: 20px;
    }
    
    .hive-popup-message {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .hive-popup-btn-primary {
        width: 100%;
        min-width: auto;
        padding: 14px 24px;
        font-size: 15px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .hive-popup-container {
        border: 2px solid #000;
    }
    
    .hive-popup-btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .hive-popup-btn-primary:hover {
        background: #333;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hive-popup-overlay,
    .hive-popup-container,
    .hive-popup-btn,
    .hive-popup-close {
        transition: none;
        animation: none;
    }
    
    .hive-popup-container.hive-popup-animate-in {
        transform: none;
    }
    
    .hive-popup-icon {
        animation: none;
    }
    
    .hive-popup-btn-primary:hover {
        transform: none;
    }
}

/* Force light mode - dark mode support removed */