/**
 * Smart Subscription Retention Flow - Modal Styles
 */

/* Modal Overlay */
.ssr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.ssr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.ssr-modal-content {
    position: relative;
    max-width: 600px;
    max-height: 90vh;
    margin: 5% auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
    animation: ssr-modal-fade-in 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes ssr-modal-fade-in {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.ssr-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    z-index: 1000001;
}

.ssr-modal-close:hover {
    color: #333;
}

/* Modal Header */
.ssr-modal-header {
    padding: 40px 40px 20px;
    border-bottom: 1px solid #eee;
}

.ssr-modal-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

/* Modal Body */
.ssr-modal-body {
    padding: 30px 40px;
    min-height: 200px;
}

#ssr-modal-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Reasons List */
.ssr-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ssr-reason-option {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    color: #333;
    text-align: left;
    width: 100%;
}

.ssr-reason-option:hover {
    background: #f0f2f5;
    border-color: #999;
}

.ssr-reason-option.selected {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

.ssr-reason-icon {
    width: 20px;
    height: 20px;
    border: 2px solid #999;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    flex-shrink: 0;
}

.ssr-reason-option.selected .ssr-reason-icon {
    border-color: #2196f3;
    background: #2196f3;
}

.ssr-reason-option.selected .ssr-reason-icon:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.ssr-reason-text {
    flex: 1;
}

/* Offer Container */
.ssr-offer-container {
    text-align: center;
}

.ssr-offer-discount {
    font-size: 48px;
    font-weight: 700;
    color: #4caf50;
    margin: 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ssr-offer-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.ssr-offer-buttons .button {
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 6px;
    min-width: 150px;
}

/* Accept Offer button when standalone */
.ssr-offer-container #ssr-accept-offer {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    margin-top: 30px;
    min-width: 200px;
}

/* Manual Support Container */
.ssr-manual-support-container {
    text-align: center;
}

.ssr-manual-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.ssr-manual-buttons .button {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    min-width: 200px;
}

/* Modal Footer */
.ssr-modal-footer {
    padding: 20px 40px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#ssr-stay-button {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    min-width: 200px;
    cursor: pointer;
}

#ssr-continue-link {
    color: #999;
    text-decoration: none;
    font-size: 20px !important;
    font-weight: 600 !important;
    transition: color 0.2s ease;
}

#ssr-continue-link:hover {
    color: #666;
    text-decoration: underline;
}

/* Loading State */
.ssr-modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000002;
}

.ssr-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196f3;
    border-radius: 50%;
    animation: ssr-spin 1s linear infinite;
}

@keyframes ssr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Body Lock */
body.ssr-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .ssr-modal-content {
        margin: 20px;
        max-width: none;
        max-height: calc(100vh - 40px);
    }

    .ssr-modal-header {
        padding: 30px 25px 15px;
    }

    .ssr-modal-header h2 {
        font-size: 24px;
    }

    .ssr-modal-body {
        padding: 20px 25px;
    }

    .ssr-modal-footer {
        padding: 15px 25px 30px;
    }

    .ssr-offer-discount {
        font-size: 36px;
    }

    .ssr-offer-buttons,
    .ssr-manual-buttons {
        flex-direction: column;
    }

    .ssr-offer-buttons .button,
    .ssr-manual-buttons .button {
        width: 100%;
        min-width: auto;
    }

    #ssr-stay-button {
        width: 100%;
        min-width: auto;
    }

    #ssr-continue-link {
        font-size: 16px !important;
    }
}

/* WooCommerce Button Override */
.woocommerce-account .ssr-cancel-trigger {
    cursor: pointer !important;
}

/* Animation for step transitions */
.ssr-modal-body,
.ssr-modal-header {
    transition: opacity 0.3s ease;
}
