/**
 * Checkout Modal Styles
 * Professional, polished design with modern typography
 */

.ticketpaygo-checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overscroll-behavior: contain;
}

.checkout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 1;
}

.checkout-modal-container {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 2;
}

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

.checkout-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.checkout-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.checkout-modal-close svg {
    color: #666;
}

.checkout-modal-content {
    padding: 40px 32px 32px;
}

.checkout-header {
    text-align: center;
    margin-bottom: 32px;
}

.checkout-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
    color: #2c2e2f;
    letter-spacing: -0.5px;
}

.checkout-subtitle {
    margin: 0;
    font-size: 15px;
    color: #6c7378;
    font-weight: 400;
    line-height: 1.5;
}

/* Order Summary */
.checkout-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-row.total {
    padding-top: 12px;
    border-top: 2px solid #e0e0e0;
    margin-top: 12px;
    font-weight: 600;
    font-size: 18px;
}

.summary-label {
    color: #6c7378;
    font-size: 15px;
    font-weight: 400;
}

.summary-row.total .summary-label {
    color: #2c2e2f;
    font-size: 17px;
    font-weight: 600;
}

.summary-value {
    color: #2c2e2f;
    font-weight: 500;
    font-size: 15px;
}

.summary-row.total .summary-value {
    color: #0070ba;
    font-size: 22px;
    font-weight: 600;
}

/* Auth Toggle */
.checkout-auth-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-toggle-btn:hover {
    background: #e8e8e8;
}

.auth-toggle-btn.active {
    background: #e3f2fd;
    border-color: #0066cc;
    color: #0066cc;
}

.auth-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* User Info Card */
.checkout-user-info {
    margin-bottom: 24px;
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.user-info-card svg {
    color: #0066cc;
    flex-shrink: 0;
}

.user-info-details {
    flex: 1;
}

.user-name {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
}

.user-email {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Guest Form */
.checkout-guest-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

/* Login Form */
.checkout-login-form {
    text-align: center;
    padding: 32px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 24px;
}

.login-message {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
}

.btn-login {
    display: inline-block;
    padding: 12px 32px;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-login:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* Payment Methods */
.checkout-payment-methods {
    margin-bottom: 24px;
}

.checkout-payment-methods h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.payment-methods-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method-option {
    display: block;
    cursor: pointer;
}

.payment-method-option input[type="radio"] {
    display: none;
}

.payment-method-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.2s;
}

.payment-method-option input[type="radio"]:checked + .payment-method-card {
    background: #e3f2fd;
    border-color: #0066cc;
}

.payment-method-card:hover {
    border-color: #b0b0b0;
}

.payment-method-option input[type="radio"]:checked + .payment-method-card:hover {
    border-color: #0066cc;
}

.payment-method-name {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
}

.payment-method-desc {
    font-size: 13px;
    color: #666;
}

/* Submit Button */
.btn-checkout-submit {
    width: 100%;
    padding: 16px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-checkout-submit:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-checkout-submit:active {
    transform: translateY(0);
}

.btn-checkout-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .ticketpaygo-checkout-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .checkout-modal-container {
        max-width: 100%;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
        min-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .checkout-modal-close {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 100;
    }
    
    .checkout-modal-content {
        padding: 20px 20px 100px;
    }
    
    .checkout-header h2 {
        font-size: 22px;
        padding-right: 40px;
    }
    
    .checkout-auth-toggle {
        flex-direction: column;
    }
    
    .btn-checkout-submit {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        padding: 18px 24px calc(18px + env(safe-area-inset-bottom, 20px));
        z-index: 1000000;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* Prevent body scroll when modal is open */
body.checkout-modal-open {
    overflow: hidden !important;
    touch-action: none !important;
}
