/* ===========================================
   WCT GoTo Modal - Fullscreen
   =========================================== */

.wct-goto-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wct-goto-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.wct-goto-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #272a31;
}

.wct-goto-modal__container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    overflow-y: auto;
}

.wct-goto-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}

.wct-goto-modal__close:hover {
    background: #e5e7eb;
}

.wct-goto-modal__close svg {
    width: 24px;
    height: 24px;
    color: #272a31;
}

.wct-goto-modal__content {
    width: 100%;
    max-width: 800px;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
}

/* Hide content when showing loading or message */
.wct-goto-modal--loading .wct-goto-modal__content,
.wct-goto-modal--message .wct-goto-modal__content {
    display: none;
}

/* ===========================================
   Loading State
   =========================================== */

.wct-goto-modal__loading {
    text-align: center;
}

.wct-goto-modal--loading .wct-goto-modal__loading {
    display: block !important;
}

.wct-goto-modal__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: wct-goto-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes wct-goto-spin {
    to { transform: rotate(360deg); }
}

.wct-goto-modal__loading-text {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
}

/* ===========================================
   Message State
   =========================================== */

.wct-goto-modal__message {
    text-align: center;
    max-width: 400px;
}

.wct-goto-modal--message .wct-goto-modal__message {
    display: block !important;
}

.wct-goto-modal__message-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wct-goto-modal__message-icon::before {
    font-size: 32px;
}

/* Success */
.wct-goto-modal--success .wct-goto-modal__message-icon {
    background: #d1fae5;
}

.wct-goto-modal--success .wct-goto-modal__message-icon::before {
    content: '✓';
    color: #059669;
}

/* Duplicate */
.wct-goto-modal--duplicate .wct-goto-modal__message-icon {
    background: #fef3c7;
}

.wct-goto-modal--duplicate .wct-goto-modal__message-icon::before {
    content: '!';
    color: #d97706;
}

/* Error */
.wct-goto-modal--error .wct-goto-modal__message-icon {
    background: #fee2e2;
}

.wct-goto-modal--error .wct-goto-modal__message-icon::before {
    content: '✕';
    color: #dc2626;
}

.wct-goto-modal__message-text {
    font-size: 1.1rem;
    color: #272a31;
    margin: 0 0 24px;
    line-height: 1.6;
}

.wct-goto-modal__message-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: #272a31;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wct-goto-modal__message-close:hover {
    background: #000000;
}

/* ===========================================
   Formidable Form Styling inside Modal
   =========================================== */

.wct-goto-modal .frm_forms {
    margin: 0;
}

.wct-goto-modal .frm_form_field {
    margin-bottom: 20px;
}

.wct-goto-modal .frm_form_field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #272a31;
    margin-bottom: 6px;
}

.wct-goto-modal .frm_form_field input[type="text"],
.wct-goto-modal .frm_form_field input[type="email"],
.wct-goto-modal .frm_form_field select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.wct-goto-modal .frm_form_field input:focus,
.wct-goto-modal .frm_form_field select:focus {
    outline: none;
    border-color: #2563eb;
}

.wct-goto-modal .frm_submit button {
    width: 100%;
    padding: 14px 24px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wct-goto-modal .frm_submit button:hover {
    background: #1d4ed8;
}

/* ===========================================
   Button Trigger
   =========================================== */

.wct-goto-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wct-goto-btn:hover {
    background: #1d4ed8;
}

/* ===========================================
   Responsive
   =========================================== */

/* Hide Formidable success messages inside modal */
#wct-goto-modal .frm_message:not(.wct-goto-success-message):not(.wct-goto-duplicate-message),
#wct-goto-modal .frm_success_style:not(.wct-goto-success-message):not(.wct-goto-duplicate-message),
#wct-goto-modal .frm_message:not(.wct-goto-success-message):not(.wct-goto-duplicate-message) p,
#wct-goto-modal .frm_success_style:not(.wct-goto-success-message):not(.wct-goto-duplicate-message) p {
    display: none !important;
}

/* Show our custom messages */
#wct-goto-modal .wct-goto-error-message,
#wct-goto-modal .wct-goto-success-message,
#wct-goto-modal .wct-goto-duplicate-message {
    display: block !important;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Error message styling */
#wct-goto-modal .wct-goto-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

#wct-goto-modal .wct-goto-error-message strong {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Success message styling */
#wct-goto-modal .wct-goto-success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

#wct-goto-modal .wct-goto-success-message strong {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Duplicate message styling */
#wct-goto-modal .wct-goto-duplicate-message {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

#wct-goto-modal .wct-goto-duplicate-message strong {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Keep form visible - we show messages above submit button */

/* Ensure our modal messages are visible */
#wct-goto-modal.wct-goto-modal--message .wct-goto-modal__message,
#wct-goto-modal.wct-goto-modal--loading .wct-goto-modal__loading {
    display: block !important;
}

@media (max-width: 600px) {
    .wct-goto-modal__container {
        padding: 80px 16px 40px;
    }
    
    .wct-goto-modal__content {
        padding: 24px;
    }
    
    .wct-goto-modal__close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

