/**
 * Outreach - Public Form Styles
 *
 * Styles for subscription forms rendered via shortcodes.
 * These styles are isolated from the Vue admin app.
 */

/* Form container */
.wpo-subscribe-form {
    max-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.wpo-subscribe-form * {
    box-sizing: border-box;
}

/* Form layout */
.wpo-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Form fields */
.wpo-form-field {
    display: flex;
    flex-direction: column;
}

/* Input styles */
.wpo-form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #1e293b;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpo-form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wpo-form-input::placeholder {
    color: #94a3b8;
}

/* Button styles */
.wpo-form-button {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wpo-form-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.wpo-form-button:active {
    transform: translateY(0);
}

.wpo-form-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner */
.wpo-spinner {
    width: 18px;
    height: 18px;
    animation: wpo-spin 1s linear infinite;
}

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

/* Success/Error message */
.wpo-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.wpo-form-message.wpo-success {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.wpo-form-message.wpo-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Radio group styles */
.wpo-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.wpo-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.wpo-radio-label:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.wpo-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #6366f1;
}

.wpo-radio-label span {
    font-size: 14px;
    color: #334155;
}

/* Honeypot field - hidden from view */
.wpo-hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Inline form variant */
.wpo-subscribe-form.wpo-inline .wpo-form {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.wpo-subscribe-form.wpo-inline .wpo-form-field {
    flex: 1;
    min-width: 200px;
}

.wpo-subscribe-form.wpo-inline .wpo-form-field:has(.wpo-form-button) {
    flex: 0 0 auto;
    min-width: auto;
}

/* Post subscription form specific */
.wpo-post-subscribe-form {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wpo-subscribe-form {
        color: #f1f5f9;
    }

    .wpo-form-input {
        background-color: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }

    .wpo-form-input:focus {
        border-color: #818cf8;
        box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
    }

    .wpo-form-input::placeholder {
        color: #64748b;
    }

    .wpo-radio-label {
        background: #1e293b;
        border-color: #334155;
    }

    .wpo-radio-label:hover {
        border-color: #475569;
        background: #334155;
    }

    .wpo-radio-label span {
        color: #e2e8f0;
    }

    .wpo-post-subscribe-form {
        background: #0f172a;
        border-color: #1e293b;
    }

    .wpo-form-message.wpo-success {
        background-color: #064e3b;
        color: #6ee7b7;
        border-color: #047857;
    }

    .wpo-form-message.wpo-error {
        background-color: #7f1d1d;
        color: #fca5a5;
        border-color: #dc2626;
    }
}

/* ==========================================================================
   Floating Button & Modal Styles
   ========================================================================== */

/* Floating Button */
.wpo-float-button {
    position: fixed;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wpo-float-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.wpo-float-bottom-right {
    bottom: 24px;
    right: 24px;
}

.wpo-float-bottom-left {
    bottom: 24px;
    left: 24px;
}

.wpo-float-icon {
    width: 20px;
    height: 20px;
}

/* Modal Overlay */
.wpo-float-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}

.wpo-float-modal.wpo-modal-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.wpo-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: calc(100% - 32px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: wpo-modal-slide-up 0.2s ease;
}

@keyframes wpo-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpo-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.wpo-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.wpo-modal-close svg {
    width: 16px;
    height: 16px;
}

/* After Content Form Styles */
.wpo-after-content {
    margin-top: 40px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.wpo-form-header {
    margin-bottom: 16px;
}

.wpo-form-heading {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.wpo-form-description {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #64748b;
}

.wpo-subscriber-count {
    margin: 0;
    font-size: 13px;
    color: #6366f1;
}

.wpo-subscriber-count .wpo-count {
    font-weight: 600;
}

/* Modal form adjustments */
.wpo-modal-content .wpo-post-subscribe-form {
    padding: 0;
    background: none;
    border: none;
}

/* Dark mode for floating modal */
@media (prefers-color-scheme: dark) {
    .wpo-modal-content {
        background: #1e293b;
    }

    .wpo-modal-close {
        background: #334155;
        color: #94a3b8;
    }

    .wpo-modal-close:hover {
        background: #475569;
        color: #f1f5f9;
    }

    .wpo-after-content {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #334155;
    }

    .wpo-form-heading {
        color: #f1f5f9;
    }

    .wpo-form-description {
        color: #94a3b8;
    }
}
