/**
 * NMI Wallets CSS
 * Styles for Apple Pay and Google Pay integration
 */

/* Express Checkout Container */
.nmi-express-checkout-container {
    border: 1px solid #e1e5e9;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.nmi-express-checkout-container:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.nmi-express-checkout-title {
    text-align: center;
    position: relative;
    margin-bottom: 20px;
    margin-top: -35px;
}

.nmi-express-checkout-title span {
    background: #ffffff;
    padding: 0 15px;
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-size: 16px;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nmi-express-checkout-content {
    text-align: center;
    padding: 10px 0;
}

/* Wallet Buttons */
#applepaybutton,
#googlepaybutton {
    display: inline-block;
    margin: 8px;
    min-height: 64px;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: none;
    flex: 1;
    min-width: 200px;
}
/* Shift Apple Pay iframe container 4px up */
#applepaybutton {
    position: relative;
    top: -4px;
  }
  
#applepaybutton:hover,
#googlepaybutton:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

/* Loading Overlay */
#nmi-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease;
}

.nmi-loading-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    margin: 1rem;
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); */
    animation: slideUp 0.3s ease;
}

.nmi-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: nmi-spin 1s linear infinite;
    margin: 0 auto 15px;
}

.nmi-loading-text {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
    font-weight: 500;
    line-height: 1.4;
}

/* Spinner Animation */
@keyframes nmi-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Styles */
#nmi_wallets_form {
    margin: 0;
    padding: 0;
}

#nmi_wallets_form input[type="hidden"] {
    display: none;
}

/* Wallet Button Container */
.nmi-wallets-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Enhanced Button Styling */
.nmi-wallet-button {
    position: relative;
    overflow: hidden;
}

.nmi-wallet-button::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;
}

.nmi-wallet-button:hover::before {
    left: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nmi-express-checkout-container {
        padding: 15px;
        margin: 15px 0;
        border-radius: 4px;
    }
    
    .nmi-express-checkout-title {
        margin-bottom: 15px;
        margin-top: -25px;
    }
    
    .nmi-express-checkout-title span {
        font-size: 14px;
        padding: 0 10px;
        letter-spacing: 0.2px;
    }
    
    #applepaybutton,
    #googlepaybutton {
        min-height: 56px;
        width: 100%;
        max-width: 320px;
        margin: 6px 0;
        flex: none;
    }
    
    .nmi-wallets-container {
        flex-direction: column;
        gap: 10px;
        margin: 15px 0;
    }
    
    .nmi-loading-content {
        padding: 25px;
        margin: 0.75rem;
        border-radius: 10px;
    }
    
    .nmi-loading-spinner {
        width: 40px;
        height: 40px;
        margin-bottom: 12px;
    }
    
    .nmi-loading-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .nmi-express-checkout-container {
        padding: 12px;
        margin: 12px 0;
        border-radius: 4px;
    }
    
    .nmi-express-checkout-title {
        margin-bottom: 12px;
        margin-top: -20px;
    }
    
    .nmi-express-checkout-title span {
        font-size: 13px;
        padding: 0 8px;
        letter-spacing: 0.1px;
    }
    
    #applepaybutton,
    #googlepaybutton {
        min-height: 48px;
        max-width: 280px;
        margin: 4px 0;
        flex: none;
    }
    
    .nmi-loading-content {
        margin: 0.5rem;
        padding: 20px;
        border-radius: 8px;
    }
    
    .nmi-loading-text {
        font-size: 1rem;
    }
    
    .nmi-loading-spinner {
        width: 36px;
        height: 36px;
        margin-bottom: 10px;
    }
}

/* Accessibility */
.nmi-express-checkout-container:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
    /* box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1); */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nmi-express-checkout-container {
        border-color: #000;
        background: #fff;
    }
    
    .nmi-express-checkout-title span {
        background: #000;
        color: #fff;
    }
    
    .nmi-loading-content {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .nmi-loading-spinner {
        animation: none;
    }
    
    .nmi-express-checkout-container {
        transition: none;
    }
    
    .nmi-express-checkout-container:hover {
        transform: none;
    }
    
    #applepaybutton:hover,
    #googlepaybutton:hover {
        transform: none;
    }
    
    @keyframes nmi-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(0deg); }
    }
    
    @keyframes fadeIn {
        from { opacity: 1; }
        to { opacity: 1; }
    }
    
    @keyframes slideUp {
        from { 
            opacity: 1;
            transform: translateY(0);
        }
        to { 
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .nmi-express-checkout-container {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .nmi-express-checkout-title span {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .nmi-loading-content {
        background: #34495e;
        color: #ecf0f1;
    }
    
    .nmi-loading-text {
        color: #ecf0f1;
    }
}

/* Cancel Button Styling */
.button.cancel {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.button.cancel:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
    text-decoration: none;
    transform: translateY(-1px);
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

/* Print styles */
@media print {
    .nmi-express-checkout-container {
        border: 1px solid #000;
        /* box-shadow: none; */
        background: #fff;
        color: #000;
    }
    
    .nmi-express-checkout-title span {
        background: #fff;
        color: #000;
    }
    
    #applepaybutton,
    #googlepaybutton {
        display: none;
    }
    
    .button.cancel {
        display: none;
    }
}
