      
/*
   CeyPay Payment Gateway Styles
   Modern List Layout - Clean & Professional
*/

@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

:root {
    --ceypay-font: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ceypay-bg: linear-gradient(180deg, #ffffff, #f0f4fc);
    --ceypay-text: #0F172A;
    --ceypay-text-muted: #64748b;
    --ceypay-border: #E2E8F0;
    --ceypay-primary: #3b82f6;
    --ceypay-hover: #F8FAFC;
    --ceypay-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --ceypay-radius: 20px;
}

/* --- Modal Core --- */
.ceypay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-family: var(--ceypay-font);
}

.ceypay-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.ceypay-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.ceypay-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 600px;
    max-height: 90dvh;
    background: var(--ceypay-bg);
    border-radius: var(--ceypay-radius);
    box-shadow: var(--ceypay-shadow);
    padding: 0;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- View Transition Animations (GPU Optimized) --- */
#ceypay-view-provider,
#ceypay-view-qr {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    perspective: 1000px;
}

/* Slide out to left (when going to QR) */
#ceypay-view-provider.ceypay-view--exit {
    animation: ceypay-slide-out-left 0.25s ease-out forwards;
}

/* Slide in from right (QR appearing) */
#ceypay-view-qr.ceypay-view--enter {
    animation: ceypay-slide-in-right 0.25s ease-out forwards;
}

/* Slide out to right (when going back to providers) */
#ceypay-view-qr.ceypay-view--exit {
    animation: ceypay-slide-out-right 0.25s ease-out forwards;
}

/* Slide in from left (providers reappearing) */
#ceypay-view-provider.ceypay-view--enter {
    animation: ceypay-slide-in-left 0.25s ease-out forwards;
}

@keyframes ceypay-slide-out-left {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
    100% {
        opacity: 0;
        transform: translate3d(-20px, 0, 0);
    }
}

@keyframes ceypay-slide-in-right {
    0% {
        opacity: 0;
        transform: translate3d(20px, 0, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes ceypay-slide-out-right {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
    100% {
        opacity: 0;
        transform: translate3d(20px, 0, 0);
    }
}

@keyframes ceypay-slide-in-left {
    0% {
        opacity: 0;
        transform: translate3d(-20px, 0, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    #ceypay-view-provider,
    #ceypay-view-qr {
        animation-duration: 0.15s !important;
    }
}

.ceypay-modal.is-visible .ceypay-modal__dialog {
    transform: translateY(0);
}

.ceypay-modal__close {
    width: 36px;
    height: 36px;
    border: none;
    background: #F1F3F5;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ceypay-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    grid-column: 3;
    grid-row: 1;
}

.ceypay-modal__close:focus {
    outline: none;
}

.ceypay-modal__close:hover {
    background: #e2eaf2;
}

/* --- Header --- */
.ceypay-modal__header {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    gap: 16px;
    align-items: center;
    padding: 20px 24px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--ceypay-border);
}

.ceypay-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #F1F3F5;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ceypay-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    grid-column: 1;
    grid-row: 1;
}

.ceypay-back-btn:hover {
    background: #e2eaf2;
}

.ceypay-back-btn:focus {
    outline: none;
}

.ceypay-help-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #F1F3F5;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ceypay-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    grid-column: 1;
    grid-row: 1;
}

.ceypay-help-btn:hover {
    background: #e2eaf2;
}

.ceypay-help-btn:focus {
    outline: none;
}

/* Hide help button when back button is visible (QR page) */
.ceypay-back-btn:not([style*="display: none"]) ~ .ceypay-modal__title ~ .ceypay-help-btn {
    display: none !important;
}

.ceypay-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ceypay-text);
    margin: 0;
    line-height: 1.2;
    text-align: center;
    grid-column: 2;
    grid-row: 1;
}

/* Hide old pill style */
.ceypay-pill {
    display: none;
}

.ceypay-modal__subtitle {
    font-size: 13px;
    color: var(--ceypay-text-muted);
    margin: 0;
    padding: 16px 24px 8px 24px;
    line-height: 1.3;
    text-align: center;
    font-weight: 400;
}

.ceypay-error-message {
    margin: 0 24px 16px 24px;
    padding: 12px 16px;
    background-color: #FEF2F2; /* Red 50 */
    border: 1px solid #FCA5A5; /* Red 300 */
    border-radius: 8px;
    color: #991B1B; /* Red 800 */
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.05);
    animation: ceypay-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top center;
}

.ceypay-error-message.is-hiding {
    animation: ceypay-fade-out 0.3s ease-in forwards;
}

@keyframes ceypay-slide-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ceypay-fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-5px); }
}

.ceypay-alert-icon {
    flex-shrink: 0;
    color: #DC2626; /* Red 600 */
    margin-top: 1px;
}

.ceypay-amount-highlight {
    color: var(--ceypay-text);
    font-weight: 700;
    font-size: 1.1em;
}

.ceypay-amount-secondary {
    color: var(--ceypay-text-muted);
    font-size: 0.9em;
    font-weight: 500;
}

.ceypay-qr-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--ceypay-text);
    width: 100%;
    text-align: center;
}

/* --- Tooltip --- */
.ceypay-tooltip {
    position: fixed;
    background: #ffffff;
    color: #0F172A;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
    z-index: 100000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #E2E8F0;
    text-align: center;
}

.ceypay-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ceypay-tooltip a {
    color: var(--ceypay-primary);
    text-decoration: none;
    font-weight: 400;
}

.ceypay-tooltip a:hover {
    text-decoration: underline;
}

/* Arrow for tooltip (pointing down) */
.ceypay-tooltip::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #ffffff;
}

/* Arrow border for tooltip */
.ceypay-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #E2E8F0;
}

/* --- Provider List --- */
.ceypay-modal__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
}

.ceypay-modal__body::-webkit-scrollbar {
    width: 4px;
}

.ceypay-modal__body::-webkit-scrollbar-track {
    background: transparent;
}

.ceypay-modal__body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

/* QR view centering */
#ceypay-view-qr {
    justify-content: center;
    align-items: center;
    padding: 0;
}

.ceypay-provider-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    padding-top: 20px;
    padding-bottom: 20px;
}

.ceypay-provider-btn {
    display: flex;
    align-items: center;
    width: 100%;
    align-self: stretch;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--ceypay-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    min-height: 68px;
    box-sizing: border-box;
}

.ceypay-provider-btn:hover {
    border-color: var(--ceypay-primary);
    background: #F8FAFC;
}

.ceypay-provider-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
}

.ceypay-provider-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.ceypay-provider-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ceypay-provider-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ceypay-text);
    line-height: 1.3;
}

.ceypay-provider-desc {
    font-size: 12px;
    color: var(--ceypay-text-muted);
    line-height: 1.3;
}

.ceypay-chevron {
    color: #cbd5e1;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: auto;
}

.ceypay-provider-btn:hover .ceypay-chevron {
    color: var(--ceypay-primary);
    transform: translateX(2px);
}

/* --- Disabled State (Coming Soon) --- */
.ceypay-provider-btn--disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.ceypay-provider-btn--disabled:hover {
    border-color: var(--ceypay-border);
    background: #ffffff;
    transform: none;
    box-shadow: none;
}

.ceypay-badge {
    padding: 3px 8px;
    background: #E2E8F0;
    color: #64748b;
    font-size: 9px;
    font-weight: 500;
    border-radius: 20px;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

/* --- Loading State --- */
.ceypay-provider-btn.is-loading {
    pointer-events: none;
    opacity: 0.8;
}

.ceypay-provider-btn.is-loading .ceypay-chevron {
    display: none;
}

.ceypay-provider-btn.is-loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--ceypay-primary);
    border-radius: 50%;
    animation: ceypay-spin 0.8s linear infinite;
    position: absolute;
    right: 16px;
}

@keyframes ceypay-spin {
    to { transform: rotate(360deg); }
}

/* --- QR View --- */
.ceypay-qr {
    position: relative;
    background: #F8FAFC;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #E2E8F0;
}

.ceypay-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.ceypay-qr__logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    padding: 7px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    z-index: 8;
    display: none;
    align-items: center;
    justify-content: center;
}

.ceypay-qr__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ceypay-qr__loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    z-index: 5;
    border-radius: 12px;
}

.ceypay-qr__loading .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
    border-color: #f1f5f9;
    border-top-color: var(--ceypay-primary);
}

.ceypay-qr__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 12px;
    z-index: 10;
}

.ceypay-qr.is-success .ceypay-qr__overlay {
    opacity: 1;
    visibility: visible;
}

.ceypay-check {
    width: 64px;
    height: 64px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: ceypay-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ceypay-check svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes ceypay-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.ceypay-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    color: var(--ceypay-text-muted);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.ceypay-status.is-hidden {
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--ceypay-primary);
    border-radius: 50%;
    animation: ceypay-spin 0.8s linear infinite;
    display: inline-block;
}

.ceypay-ripple {
    display: inline-block;
    position: relative;
    width: 8px;
    height: 8px;
    background: var(--ceypay-primary);
    border-radius: 50%;
    vertical-align: middle;
}

/* shared ripple base */
.ceypay-ripple::before,
.ceypay-ripple::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: ceypay-ripple 2s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.ceypay-ripple::after {
    animation-delay: -1s;
}

@keyframes ceypay-ripple {
    0% {
        box-shadow: 0 0 0 0 var(--ceypay-primary);
        opacity: 0.8;
    }
    100% {
        box-shadow: 0 0 0 12px var(--ceypay-primary);
        opacity: 0;
    }
}

/* User Review State */
.ceypay-status.is-user-review {
    color: #d97706; /* Amber 600 */
}

.ceypay-ripple--review {
    background: #f59e0b; /* Amber 500 */
}

.ceypay-ripple--review::before,
.ceypay-ripple--review::after {
    animation: ceypay-ripple-review 2s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.ceypay-ripple--review::after {
    animation-delay: -1s;
}

@keyframes ceypay-ripple-review {
    0% {
        box-shadow: 0 0 0 0 #f59e0b;
        opacity: 0.8;
    }
    100% {
        box-shadow: 0 0 0 12px #f59e0b;
        opacity: 0;
    }
}

/* Expired State */
.ceypay-status.is-expired {
    color: #dc2626; /* Red 600 */
}

.ceypay-qr.is-expired {
    position: relative;
}

.ceypay-qr.is-expired::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    z-index: 5;
}

.ceypay-qr.is-expired::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: #dc2626;
    border-radius: 50%;
    z-index: 6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
}

/* --- Actions --- */
.ceypay-modal__actions {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 24px 12px 24px !important;
    background: transparent !important;
}

.ceypay-modal__actions[style*="display: none"] {
    display: none !important;
}

.ceypay-modal__actions:not([style*="display: none"]) {
    display: flex !important;
}

.ceypay-btn {
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 40px !important;
    line-height: 1.4 !important;
    font-family: var(--ceypay-font) !important;
}

.ceypay-btn--primary {
    background: var(--ceypay-primary) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2) !important;
}

.ceypay-btn--primary:hover {
    background: #2563eb !important;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3) !important;
}

.ceypay-btn--ghost {
    background: #ffffff !important;
    color: var(--ceypay-text) !important;
    border: 1px solid var(--ceypay-border) !important;
    box-shadow: none !important;
}

.ceypay-btn--ghost:hover {
    background: var(--ceypay-hover) !important;
}

/* --- Modal Footer --- */
.ceypay-modal__footer {
    padding: 12px 24px !important;
    flex-shrink: 0 !important;
    text-align: center !important;
    background: transparent !important;
    border-top: 1px solid var(--ceypay-border) !important;
}

.ceypay-footer-text {
    margin: 0 0 2px 0 !important;
    font-size: 11px !important;
    color: #94a3b8 !important;
    line-height: 1.3 !important;
    font-family: var(--ceypay-font) !important;
}

.ceypay-footer-link {
    color: var(--ceypay-primary) !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}

.ceypay-footer-link:hover {
    text-decoration: none !important;
    opacity: 0.8 !important;
}

.ceypay-footer-powered {
    margin: 0 !important;
    font-size: 10px !important;
    color: #94a3b8 !important;
    font-weight: 400 !important;
    font-family: var(--ceypay-font) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
}

.ceypay-footer-brand {
    color: #64748b !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
}

.ceypay-footer-logo {
    height: 11px !important;
    width: auto !important;
    opacity: 0.8 !important;
    display: block !important;
}

/* --- End of Styles --- */
