/**
 * Sendy Subscribe Form Styles
 */

.wsc-subscribe-form-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 10px auto 20px;
    display: none; /* Hide by default to prevent "pop" when cookie exists */
}

/* Fallback if JS is disabled */
.wsc-subscribe-form-wrapper.wsc-no-js {
    display: block;
}

.wsc-subscribe-form {
    background: #ffffff;
    border: 0px solid #e8e8e8;
    border-radius: 6px;
    padding: 5px 5px;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); */
}

/* Ensure block editor preview has proper spacing */
.wsc-block-preview .wsc-subscribe-form-content,
.wp-block-sendy-latest-post-subscribe-form .wsc-subscribe-form-content,
.wsc-subscribe-form-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.wsc-block-preview .wsc-form-group,
.wp-block-sendy-latest-post-subscribe-form .wsc-form-group {
    display: flex !important;
    flex-direction: column !important;
}

.wsc-subscribe-form-title {
    margin: 0 0 24px !important;
    padding: 0;
    line-height: 1.3;
}

.wsc-subscribe-form-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Screen reader only */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.wsc-form-group {
    display: flex;
    flex-direction: column;
}

.wsc-form-group label:not(.screen-reader-text) {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
}

.wsc-form-group input, .wsc-form-input {
    padding: 12px 14px !important;
    font-size: 16px !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    color: #333333 !important;
    transition: border-color 0.2s ease !important;
    font-family: inherit;
}

.wsc-form-input:focus {
    outline: none;
    border-color: #333333;
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

.wsc-form-input::placeholder {
    color: #999999;
}

.wsc-form-button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #333333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 8px;
}

.wsc-form-button:hover {
    background: #1a1a1a;
}

.wsc-form-button:active {
    background: #000000;
}

.wsc-form-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.wsc-form-loading {
    margin-top: 12px;
    font-size: 14px;
    color: #666666;
    text-align: center;
}

.wsc-form-error {
    margin-top: 12px;
    padding: 12px;
    font-size: 14px;
    color: #d32f2f;
    background: #ffebee;
    border-radius: 4px;
    text-align: center;
}

/**
 * Message States
 */

.wsc-subscribe-message {
    padding: 16px 20px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.wsc-subscribe-message p {
    margin: 0;
    padding: 0;
}

.wsc-subscribe-success {
    background: #f0f8f0;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.wsc-subscribe-updated {
    background: #f0f7ff;
    border: 1px solid #bbdefb;
    color: #1565c0;
}

.wsc-subscribe-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/**
 * Responsive
 */

@media (max-width: 600px) {
    .wsc-subscribe-form {
        padding: 24px 16px;
    }

    .wsc-subscribe-form-title {
        font-size: 18px;
    }

    .wsc-form-input,
    .wsc-form-button {
        font-size: 16px;
    }
}
