/**
 * Fanbasis Checkout Styles
 *
 * Modal and checkout styling for the Fanbasis payment gateway.
 *
 * @package Fanbasis_WooCommerce
 */

/* Prevent body scroll when modal is open */
body.fanbasis-modal-open {
    overflow: hidden;
}

/* Modal Overlay */
.fanbasis-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}

/* Modal Container */
.fanbasis-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 900px;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fanbasisModalSlideIn 0.3s ease-out;
}

@keyframes fanbasisModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.fanbasis-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.fanbasis-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.fanbasis-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.fanbasis-modal-close:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.fanbasis-modal-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Modal Body */
.fanbasis-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 700px;
}

/* Checkout Container */
.fanbasis-checkout-container {
    width: 100%;
    min-height: 700px;
}

.fanbasis-checkout-container iframe {
    width: 100%;
    min-height: 700px;
    border: none;
}

/* Loading State */
.fanbasis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.fanbasis-loading p {
    margin: 16px 0 0;
    color: #6b7280;
    font-size: 14px;
}

/* Spinner */
.fanbasis-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: fanbasisSpin 1s linear infinite;
}

@keyframes fanbasisSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Success State */
.fanbasis-success {
    text-align: center;
    padding: 60px 20px;
}

.fanbasis-success-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    margin: 0 auto 20px;
    animation: fanbasisSuccessPop 0.4s ease-out;
}

@keyframes fanbasisSuccessPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fanbasis-success p {
    margin: 10px 0;
    color: #374151;
    font-size: 16px;
}

/* Error State */
.fanbasis-error {
    text-align: center;
    padding: 60px 20px;
}

.fanbasis-error-icon {
    width: 64px;
    height: 64px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    margin: 0 auto 20px;
}

.fanbasis-error p {
    margin: 10px 0 20px;
    color: #374151;
    font-size: 16px;
}

/* Buttons */
.fanbasis-retry-button,
.fanbasis-close-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.fanbasis-retry-button:hover,
.fanbasis-close-button:hover {
    background: #2563eb;
}

.fanbasis-retry-button:active,
.fanbasis-close-button:active {
    transform: scale(0.98);
}

.fanbasis-retry-button:focus,
.fanbasis-close-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Thank You Page Styles */
.fanbasis-thankyou-pending {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.fanbasis-thankyou-pending p {
    margin: 0;
    color: #92400e;
    font-size: 14px;
}

/* Admin Settings Styles */
.fanbasis-admin-info {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.fanbasis-admin-info h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #111827;
}

.fanbasis-admin-info ol {
    margin: 0;
    padding-left: 24px;
}

.fanbasis-admin-info li {
    margin-bottom: 8px;
    color: #374151;
}

.fanbasis-admin-info code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Responsive Adjustments */
@media screen and (max-width: 600px) {
    .fanbasis-modal-overlay {
        padding: 10px;
    }

    .fanbasis-modal {
        max-height: 95vh;
        border-radius: 8px;
    }

    .fanbasis-modal-header {
        padding: 12px 16px;
    }

    .fanbasis-modal-title {
        font-size: 16px;
    }

    .fanbasis-loading,
    .fanbasis-success,
    .fanbasis-error {
        padding: 40px 16px;
    }

    .fanbasis-success-icon,
    .fanbasis-error-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .fanbasis-modal {
        background: #1f2937;
    }

    .fanbasis-modal-header {
        background: #111827;
        border-bottom-color: #374151;
    }

    .fanbasis-modal-title {
        color: #f9fafb;
    }

    .fanbasis-modal-close {
        color: #9ca3af;
    }

    .fanbasis-modal-close:hover {
        background-color: #374151;
        color: #f9fafb;
    }

    .fanbasis-loading p {
        color: #9ca3af;
    }

    .fanbasis-spinner {
        border-color: #374151;
        border-top-color: #3b82f6;
    }

    .fanbasis-success p,
    .fanbasis-error p {
        color: #d1d5db;
    }
}

/* Print styles - hide modal when printing */
@media print {
    .fanbasis-modal-overlay {
        display: none !important;
    }
}
