/* Pay by Link Popup Styles */

/* Use existing popup-overlay and popup-container from party-popup.css */

.pay-popup {
    width: min(90vw, 480px) !important;
    max-width: 480px !important;
    min-width: auto !important;
    transition: width 0.2s ease;
    align-items: stretch !important;
    padding: 0 !important;
}

.pay-popup.iframe-active {
    width: min(90vw, 500px) !important;
    max-width: 500px !important;
}

.pay-popup.iframe-active .payment-iframe-container {
    width: 100%;
    min-height: 500px;
}

.pay-popup.iframe-active .payment-iframe-container iframe {
    width: 100% !important;
    min-height: 500px;
}

/* Header with title and breadcrumb */
.pay-popup .pay-popup-header {
    padding: 1.25rem 1.5rem 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.pay-popup .pay-popup-header .back-link {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    margin-bottom: 0.5rem;
    display: block;
}

.pay-popup .pay-popup-header .back-link:hover {
    color: #333;
}

.pay-popup .pay-popup-header .page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #007B7C;
    margin: 0 0 0.25rem 0;
}

.pay-popup .pay-popup-header .breadcrumb-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #999;
}

.pay-popup .pay-popup-header .breadcrumb-steps span.active {
    color: #007B7C;
    font-weight: 600;
}

.pay-popup .pay-popup-header .breadcrumb-steps span.clickable {
    color: #007B7C;
    cursor: pointer;
    text-decoration: underline;
}

.pay-popup .pay-popup-header .breadcrumb-steps span.clickable:hover {
    color: #006566;
}

.pay-popup .pay-popup-header .breadcrumb-steps .separator {
    color: #ccc;
}

.pay-popup .header-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0 1.5rem 1rem;
}

/* Popup Content */
.pay-popup .popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Loading State */
.pay-popup .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.pay-popup .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007B7C;
    border-radius: 50%;
    animation: pay-popup-spin 1s linear infinite;
}

.pay-popup .spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: pay-popup-spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes pay-popup-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.pay-popup .error-container {
    text-align: center;
    padding: 2rem;
}

.pay-popup .error-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f8d7da;
    color: #721c24;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.pay-popup .error-container h3 {
    color: #721c24;
    margin-bottom: 0.5rem;
}

.pay-popup .error-container p {
    color: #666;
    margin-bottom: 0.5rem;
}

.pay-popup .error-contact {
    font-size: 0.9rem;
    color: #999;
}

/* Step 1: Review Ticket */
.pay-popup .review-step {
    width: 100%;
}

.pay-popup .section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.pay-popup .ticket-card {
    background: #fff;
    margin-bottom: 1.5rem;
    width: 100%;
}

.pay-popup .ticket-header {
    padding: 0 0 1rem 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
}

.pay-popup .ticket-number {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    background: #E5F4E7;
    padding: 0.75rem;
    border-radius: 0.25rem;
}

.pay-popup .ticket-meta-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pay-popup .meta-box {
    background: #E5F4E7;
    padding: 0.75rem;
    border-radius: 0.25rem;
    display: flex;
    flex-direction: column;
}

.pay-popup .meta-box .label {
    font-size: 0.65rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.pay-popup .meta-box .value {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

.pay-popup .ticket-number .label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pay-popup .ticket-number .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.pay-popup .ticket-meta {
    font-size: 0.85rem;
    color: #666;
}

.pay-popup .ticket-meta .separator {
    margin: 0 0.5rem;
    color: #ccc;
}

.pay-popup .ticket-section {
    padding: 0 0 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.pay-popup .ticket-section h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.pay-popup .ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
}

.pay-popup .item-details {
    display: flex;
    flex-direction: column;
}

.pay-popup .item-name {
    color: #333;
    font-weight: 600;
}

.pay-popup .item-sku {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.15rem;
}

.pay-popup .item-price {
    color: #F57121;
    font-weight: 600;
}

.pay-popup .ticket-summary {
    padding: 1rem;
    background: #E5F4E7;
    border-radius: 0.5rem;
    margin: 1rem;
}

.pay-popup .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.9rem;
}

.pay-popup .summary-row span:first-child {
    color: #666;
}

.pay-popup .summary-row span:last-child {
    color: #333;
}

.pay-popup .summary-row.total-due {
    font-weight: 700;
    color: #242143;
    font-size: 1rem;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

.pay-popup .summary-row.total-due span:first-child,
.pay-popup .summary-row.total-due span:last-child {
    color: #242143;
}

.pay-popup .primary-button {
    width: 100%;
    padding: 1rem;
    background: #007B7C;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 1.5rem;
    position: relative;
}

.pay-popup .primary-button::before {
    content: '';
    position: absolute;
    top: -0.75rem;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.pay-popup .primary-button:hover {
    background: #006566;
}

/* Step 2: Tip & Payment */
.pay-popup .payment-step {
    max-width: 100%;
}

.pay-popup .tip-section {
    margin-bottom: 1.5rem;
}

.pay-popup .tip-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #333;
}

.pay-popup .tip-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pay-popup .tip-button {
    padding: 0.75rem 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.pay-popup .tip-button:hover {
    border-color: #007B7C;
}

.pay-popup .tip-button.selected {
    border-color: #007B7C;
    background: #007B7C;
    color: #fff;
}

.pay-popup .tip-button.selected .tip-label,
.pay-popup .tip-button.selected .tip-amount {
    color: #fff;
}

/* Locked/disabled tip buttons */
.pay-popup .tip-section.locked .tip-button {
    cursor: not-allowed;
    opacity: 0.7;
}

.pay-popup .tip-section.locked .tip-button:hover {
    border-color: #e0e0e0;
}

.pay-popup .tip-section.locked .tip-button.selected:hover {
    border-color: #007B7C;
}

.pay-popup .tip-label {
    font-weight: 600;
    color: #333;
}

.pay-popup .tip-amount {
    font-size: 0.85rem;
    color: #666;
}

.pay-popup .custom-tip {
    margin-top: 0.75rem;
}

.pay-popup .custom-tip-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0;
}

.pay-popup .custom-tip-toggle.selected {
    color: #007B7C;
    font-weight: 500;
}

.pay-popup .custom-tip-input {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
}

.pay-popup .custom-tip-input .currency {
    color: #666;
    margin-right: 0.25rem;
}

.pay-popup .custom-tip-input input {
    border: none;
    background: transparent;
    font-size: 1rem;
    width: 100%;
    outline: none;
}

/* Email Section */
.pay-popup .email-section {
    margin-bottom: 1.5rem;
}

.pay-popup .email-section label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.pay-popup .email-section input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.pay-popup .email-section input:focus {
    outline: none;
    border-color: #007B7C;
}

.pay-popup .email-section input.invalid {
    border-color: #dc3545;
}

.pay-popup .validation-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Payment Summary */
.pay-popup .payment-summary {
    background: #E5F4E7;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.pay-popup .payment-summary .summary-row.charging-today {
    font-weight: 700;
    font-size: 1rem;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid #e0e0e0;
}

.pay-popup .payment-summary .summary-row.charging-today span {
    color: #242143;
}

/* Tip row in payment summary - green color */
.pay-popup .payment-summary .summary-row.tip-row span {
    color: #007B7C;
}

.pay-popup .error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.pay-popup .pay-button {
    width: 100%;
    padding: 1rem;
    background: #F57121;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pay-popup .pay-button:hover:not(:disabled) {
    background: #D9621D;
}

.pay-popup .pay-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* WorldPay Iframe */
.pay-popup .payment-iframe-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 500px;
}

.pay-popup .iframe-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

.pay-popup .payment-iframe-container iframe {
    flex: 1;
    width: 100%;
    min-height: 350px;
    border: none;
    border-radius: 0.5rem;
}

.pay-popup .payment-iframe-container iframe.hidden {
    display: none;
}

.pay-popup .payment-summary-locked {
    background: #E5F4E7;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    text-align: center;
    width: 100%;
}

/* Step 3: Confirmation */
.pay-popup .confirmation-step {
    text-align: center;
    padding: 2rem 1rem;
}

.pay-popup .success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #E5F4E7;
    color: #007B7C;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.pay-popup .confirmation-step .payment-received-text {
    color: #007B7C;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.pay-popup .thank-you {
    color: #333;
    margin-bottom: 0.25rem;
}

.pay-popup .receipt-sent {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.pay-popup .receipt-sent strong {
    color: #333;
}

.pay-popup .email-sent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #E5F4E7;
    color: #007B7C;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    border: 1px solid #007B7C;
}

.pay-popup .email-sent-badge .badge-dot {
    width: 6px;
    height: 6px;
    background: #007B7C;
    border-radius: 50%;
}

.pay-popup .confirmation-step .section-label {
    text-align: left;
    max-width: 320px;
    margin: 0 auto 0.5rem;
}

.pay-popup .receipt-summary {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: left;
    max-width: 320px;
    margin: 0 auto;
}

.pay-popup .receipt-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #333;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0.75rem;
}

.pay-popup .receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.pay-popup .receipt-row span:first-child {
    color: #666;
}

.pay-popup .receipt-row span:last-child {
    color: #333;
}

.pay-popup .receipt-row.tip-row span {
    color: #007B7C;
}

.pay-popup .receipt-row.total-charged {
    font-weight: 600;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

.pay-popup .receipt-row.total-charged span {
    color: #007B7C;
}

/* Responsive - Large screens (laptops, desktops) */
@media (min-width: 1024px) {
    .pay-popup,
    .pay-popup.iframe-active {
        width: 500px !important;
        max-width: 500px !important;
    }
}

/* Responsive - Tablet landscape */
@media (min-width: 769px) and (max-width: 1023px) {
    .pay-popup,
    .pay-popup.iframe-active {
        width: 480px !important;
        max-width: 480px !important;
    }
}

/* Responsive - Tablet portrait */
@media (max-width: 768px) {
    .pay-popup,
    .pay-popup.iframe-active {
        width: 90vw !important;
        max-width: 450px !important;
        min-width: auto !important;
        margin: 1rem auto;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .pay-popup,
    .pay-popup.iframe-active {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: auto !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
    }

    .pay-popup .pay-popup-header {
        padding: 1rem 1rem 0.75rem;
    }

    .pay-popup .pay-popup-header .page-title {
        font-size: 1.25rem;
    }

    .pay-popup .pay-popup-header .breadcrumb-steps {
        font-size: 0.6rem;
    }

    .pay-popup .header-divider {
        margin: 0 1rem;
    }

    .pay-popup .popup-content {
        padding: 0 1rem 1rem;
    }

    .pay-popup .payment-step h3 {
        font-size: 1.25rem;
    }

    .pay-popup .ticket-header {
        padding: 0.75rem;
    }

    .pay-popup .ticket-meta-boxes {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .pay-popup .meta-box {
        padding: 0.5rem;
    }

    .pay-popup .ticket-section {
        padding: 0.75rem;
    }

    .pay-popup .ticket-summary {
        padding: 0.75rem;
    }

    .pay-popup .tip-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .pay-popup .tip-button {
        padding: 0.6rem 0.4rem;
    }

    .pay-popup .primary-button,
    .pay-popup .pay-button {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    .pay-popup .payment-iframe-container {
        min-height: 450px;
    }

    .pay-popup .payment-summary-locked {
        padding: 0.75rem;
    }

    .pay-popup .confirmation-step {
        padding: 1.5rem 1rem;
    }

    .pay-popup .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .pay-popup .confirmation-step h2 {
        font-size: 1.25rem;
    }

    .pay-popup .receipt-summary,
    .pay-popup .confirmation-step .section-label {
        max-width: 100%;
    }
}
