/* Miscellaneous Styles */

/* Guest Checkout Button Styles */
.pcs-checkout-button-pay-now {
    /* Define green gradient colors locally (matching guest checkout) */
    --gradient-start: #4ade80; /* Guest Checkout Green Start */
    --gradient-mid: #2cb265;   /* Calculated Mid Green */
    --gradient-end: #16a34a;   /* Guest Checkout Green End */

    display: inline-block;
    width: 100%;
    max-width: 300px;
    padding: 15px 25px;
    margin: 10px auto;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    color: #ffffff;
    
    /* Animated Green Gradient Background (matching guest checkout colors, keeping animation) */
    background: linear-gradient(145deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end), var(--gradient-start)); /* Use three colors */
    background-size: 400% 400%; /* Keep animation size */
    /* Use a new keyframe for a continuous scroll effect */
    animation: gradient-scroll-green 8s ease infinite; /* Unique animation name */
    
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 0 rgba(34, 197, 94, 0.3); /* Guest Checkout Green shadow */
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Keyframes for a continuous scrolling gradient animation (Green) */
@keyframes gradient-scroll-green { /* Unique keyframe name */
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.pcs-checkout-button-pay-now::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;
}

.pcs-checkout-button-pay-now:hover {
    /* Pause the animation on hover for a cleaner interaction */
    animation-play-state: paused;
    filter: brightness(1.1);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 0 0 3px rgba(34, 197, 94, 0.4); /* Guest Checkout Green shadow */
}

.pcs-checkout-button-pay-now:hover::before {
    left: 100%;
}

.pcs-checkout-button-pay-now:active {
    transform: translateY(0);
    filter: brightness(1);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 2px rgba(34, 197, 94, 0.5); /* Guest Checkout Green shadow */
}

.pcs-checkout-button-pay-now:focus {
    outline: none;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 3px rgba(34, 197, 94, 0.5); /* Guest Checkout Green shadow */
}

.pcs-button-icon {
    display: inline-block; /* Ensures transform is applied correctly */
    transform: rotate(0deg) scale(1) translateX(0); /* Initial state */
    transition: transform 1.5s cubic-bezier(0.23, 1, 0.32, 1); /* easeOutQuint for deceleration */
    transform-origin: center; /* Ensures rotation is around the center */
}

.pcs-checkout-button-pay-now:hover .pcs-button-icon {
    transition: transform 1s cubic-bezier(0.6, 0.04, 0.98, 0.335); /* easeInQuint for acceleration */
    transform: rotate(720deg) scale(2) translateX(-5px); /* Spin twice, zoom 100%, and move left */
}

/* Modal Styles */
.pay-now-overlay { /* Unique class */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pay-now-overlay.visible { /* Unique class */
    opacity: 1;
    visibility: visible;
}

.pay-now-modal { /* Unique class */
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.pay-now-overlay.visible .pay-now-modal { /* Unique class */
    transform: scale(1);
}

.pay-now-modal h2 { /* Unique class */
    margin-top: 0;
    font-size: 1.5rem;
    color: #333;
}

.pay-now-modal p { /* Unique class */
    margin-bottom: 2rem;
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
}

.pay-now-modal-actions { /* Unique class */
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-grow: 1;
    max-width: 200px;
}

.modal-btn.confirm {
    background-color: var(--gradient-mid); /* Uses local green gradient mid */
    color: white;
}

.modal-btn.confirm:hover {
    background-color: var(--gradient-start); /* Uses local green gradient start */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3); /* Guest Checkout Green shadow */
}

.modal-btn.cancel {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.modal-btn.cancel:hover {
    background-color: #e7e7e7;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

@keyframes call-to-action-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
}

.pay-later-fallback-active {
    animation: call-to-action-pulse 1.5s infinite ease-in-out;
}


/* Animation container styles */
.payment-icons-animated-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out; /* Adjust duration and timing function as needed */
}

.payment-icons-animated-container.show {
    max-height: 500px; /* Needs to be large enough to contain all icons */
}

/* Notification Styles */
.notification-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: -85px auto 25px; /* Move up to overlap button, add bottom margin */
    height: 60px; /* Set a fixed height for the container */
    overflow: hidden;
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through the container */
}

.notification-message {
    position: absolute;
    bottom: -100%; /* Start below the container */
    left: 0;
    width: 100%;
    padding: 15px;
    background-color: #f8d7da; /* Default error color */
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform: translateY(100%);
    pointer-events: auto; /* Capture clicks on the message itself */
}

.notification-message.show {
    bottom: 0; /* End position at the bottom of the container */
    opacity: 1;
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
    .pcs-checkout-button-pay-now { /* Unique class */
        font-size: 14px;
        padding: 12px 20px;
    }
    .pay-now-modal { /* Unique class */
        padding: 2rem 1.5rem;
    }
    .pay-now-modal-actions { /* Unique class */
        flex-direction: column;
        gap: 0.75rem;
    }
    .modal-btn {
        width: 100%;
        max-width: none;
    }
}

/* Real-time Status Styles */
.payment-status-container {
    margin-top: 20px;
    text-align: left;
    display: none; /* Hidden by default */
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInStatus 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.status-item .icon {
    margin-right: 12px;
    font-size: 1.3rem;
    width: 25px;
    text-align: center;
}

.status-item .text {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.status-item.success .icon {
    color: #28a745;
}

.status-item.success .text {
    color: #28a745;
}

.status-item.error .icon {
    color: #dc3545;
}

.status-item.error .text {
    color: #dc3545;
}

.status-item.pending .icon::before {
    content: '⏳';
    display: inline-block;
    animation: spin 1.5s linear infinite;
}

@keyframes fadeInStatus {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-methods-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
    padding: 0;
    text-align: center;
}

.payment-icons-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px; /* Reduced gap slightly to match smaller icons */
    padding: 10px;
}

.payment-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    opacity: 0.7;
    /* --- Ensures the cursor doesn't change to a pointer on hover --- */
    cursor: default;
}

.payment-icon img {
    max-width: 90px;
    max-height: 35px;
    width: auto;
    height: auto;
    object-fit: contain;
    /* --- Prevents the image itself from capturing mouse events if needed --- */
    pointer-events: none;
}

.payment-icon:hover {
    transform: translateY(-3px);
    opacity: 1;
}

.payment-icon.selected {
    opacity: 1;
    transform: scale(1.2); /* Scaled down a bit from 1.5 to be less intrusive */
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
    animation: wiggle 0.4s ease-in-out;
    cursor: pointer;
}

@keyframes wiggle {
    0% { transform: rotate(0) scale(1.2); }
    25% { transform: rotate(-4deg) scale(1.2); }
    75% { transform: rotate(4deg) scale(1.2); }
    100% { transform: rotate(0) scale(1.2); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .payment-icon img {
        max-width: 75px;
        max-height: 30px;
    }
    .payment-icons-wrap {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .payment-icon img {
        max-width: 60px;
        max-height: 25px;
    }
    .payment-icons-wrap {
        gap: 8px;
    }
}

/* Fast Fill Buttons */
.fast-fill-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    gap: 10px;
}

.fast-fill-buttons .btn-secondary {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f0f0f0;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fast-fill-buttons .btn-secondary:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.fast-fill-buttons .btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Authorize.Net Payment Notification Styles */
.payment-notification-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 450px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    animation: fadeInScale 0.3s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.payment-notification-container.hidden {
    animation: fadeOutScale 0.3s ease-in forwards;
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

.payment-notification-container .notification-header {
    background-color: #007bff;
    color: white;
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.payment-notification-container .notification-header h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
}

.payment-notification-container .spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

.payment-notification-container .close-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s ease;
}

.payment-notification-container .close-button:hover {
    color: #e0e0e0;
}

.payment-notification-container .notification-body {
    padding: 25px;
    flex-grow: 1;
}

.payment-notification-container .notification-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.payment-notification-container .step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1rem;
    color: #555;
    transition: color 0.3s ease;
}

.payment-notification-container .step:last-child {
    margin-bottom: 0;
}

.payment-notification-container .step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    font-weight: 700;
    color: white;
    background-color: #ccc; /* Default pending color */
    transition: background-color 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.payment-notification-container .step.pending .step-icon {
    background-color: #ffc107; /* Yellow for pending */
    animation: pulse 1.5s infinite;
}

.payment-notification-container .step.completed .step-icon {
    background-color: #28a745; /* Green for completed */
    transform: scale(1.1);
}

.payment-notification-container .step.failed .step-icon {
    background-color: #dc3545; /* Red for failed */
    transform: scale(1.1);
}

.payment-notification-container .step.completed .step-text {
    color: #28a745;
    font-weight: 600;
}

.payment-notification-container .step.failed .step-text {
    color: #dc3545;
    font-weight: 600;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.payment-notification-container .transaction-id-display,
.payment-notification-container .error-message-display {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    word-break: break-all;
}

.payment-notification-container .transaction-id-display {
    background-color: #e6ffed;
    color: #1a7937;
    border: 1px solid #b2f0c8;
}

.payment-notification-container .error-message-display {
    background-color: #ffe6e6;
    color: #a71a1a;
    border: 1px solid #f0b2b2;
}

.payment-notification-container .notification-footer {
    padding: 15px 25px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.payment-notification-container #notification-done-button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.payment-notification-container #notification-done-button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* Overlay for the notification */
.payment-notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: none; /* Hidden by default */
}
