/**
 * Sky360 Newsletter Widget Styles
 * Version: 1.0.0
 */

/* Wrapper */
.sky360-newsletter-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Form Layouts */
.sky360-newsletter-form {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.sky360-newsletter-form.layout-inline {
    flex-direction: row;
    align-items: stretch;
    /* Keep the email field + button on a single line on every device. */
    flex-wrap: nowrap;
}

/* Inline layout: the field absorbs the slack and may shrink to nothing, while
   the button keeps its content width and its label auto-scales with the
   viewport so the row never wraps or overflows on small screens. */
.sky360-newsletter-form.layout-inline .sky360-newsletter-field {
    flex: 1 1 0;
    /* Floor so the field stays typeable on small screens instead of
       collapsing toward zero width when the button is wide. */
    min-width: 90px;
}

.sky360-newsletter-form.layout-inline .sky360-newsletter-submit {
    flex-shrink: 0;
    /* Label scales with the viewport so the row never wraps or overflows.
       Ceiling matches a typical configured size; overrides the button
       typography font-size for inline layout by design. */
    font-size: clamp(0.72rem, 2.2vw, 1.125rem);
}

.sky360-newsletter-form.layout-inline .sky360-newsletter-input {
    min-width: 0;
}

/* On very narrow screens, trim the button's side padding so the wide
   email field keeps as much room as possible while staying on one line. */
@media (max-width: 420px) {
    .sky360-newsletter-form.layout-inline .sky360-newsletter-submit {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.sky360-newsletter-form.layout-stacked {
    flex-direction: column;
}

.sky360-newsletter-form.layout-stacked .sky360-newsletter-field {
    width: 100%;
}

.sky360-newsletter-form.layout-stacked .sky360-newsletter-submit {
    width: 100%;
}

/* Email Field Container */
.sky360-newsletter-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

/* Email Input */
.sky360-newsletter-input {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.sky360-newsletter-input:focus {
    outline: none;
}

/* Field Icon */
.sky360-field-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.sky360-field-icon.icon-left {
    left: 15px;
}

.sky360-field-icon.icon-right {
    right: 15px;
}

.sky360-newsletter-field.has-icon-left .sky360-newsletter-input {
    padding-left: 45px;
}

.sky360-newsletter-field.has-icon-right .sky360-newsletter-input {
    padding-right: 45px;
}

/* Submit Button */
.sky360-newsletter-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    border: none;
    outline: none;
    white-space: nowrap;
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.sky360-newsletter-submit:focus {
    outline: none;
}

.sky360-newsletter-submit:disabled,
.sky360-newsletter-submit.is-loading {
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Icon */
.sky360-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sky360-button-icon svg {
    display: block;
}

/* Loading Spinner */
.sky360-loading-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.sky360-spinner {
    animation: sky360-rotate 2s linear infinite;
    width: 18px;
    height: 18px;
}

.sky360-spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: sky360-dash 1.5s ease-in-out infinite;
}

@keyframes sky360-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes sky360-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Messages */
.sky360-newsletter-message {
    display: flex;
    align-items: center;
    border-width: 1px;
    border-style: solid;
    font-size: 14px;
    line-height: 1.5;
    animation: sky360-fadeIn 0.3s ease;
}

.sky360-newsletter-message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.sky360-newsletter-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.sky360-message-icon {
    margin-right: 10px;
    flex-shrink: 0;
}

.sky360-message-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.sky360-message-text {
    flex: 1;
}

@keyframes sky360-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error State */
.sky360-newsletter-input.has-error {
    animation: sky360-shake 0.4s ease;
}

@keyframes sky360-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Success Animation */
.sky360-newsletter-form.is-success {
    animation: sky360-success 0.5s ease;
}

@keyframes sky360-success {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Elementor Editor Preview */
.elementor-editor-active .sky360-newsletter-message {
    display: none !important;
}

/* RTL Support */
[dir="rtl"] .sky360-field-icon.icon-left {
    left: auto;
    right: 15px;
}

[dir="rtl"] .sky360-field-icon.icon-right {
    right: auto;
    left: 15px;
}

[dir="rtl"] .sky360-newsletter-field.has-icon-left .sky360-newsletter-input {
    padding-left: 15px;
    padding-right: 45px;
}

[dir="rtl"] .sky360-newsletter-field.has-icon-right .sky360-newsletter-input {
    padding-right: 15px;
    padding-left: 45px;
}

[dir="rtl"] .sky360-button-icon.icon-before {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .sky360-button-icon.icon-after {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .sky360-message-icon {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .sky360-loading-spinner {
    margin-left: 0;
    margin-right: 8px;
}

/* Accessibility */
.sky360-newsletter-input:focus-visible,
.sky360-newsletter-submit:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Name + CAPTCHA Popup (local store provider).
   Scoped with the container + !important on the properties arbitrary (often
   dark) themes override — headings, inputs and buttons — so the modal always
   renders with its own colours/layout regardless of the active theme. */
.sky360-nl-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.sky360-nl-popup.is-open {
    display: block;
}

.sky360-nl-popup .sky360-nl-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.sky360-nl-popup .sky360-nl-popup__card {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    margin: 12vh auto 0;
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-radius: 10px;
    padding: 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: sky360-fadeIn 0.25s ease;
}

.sky360-nl-popup .sky360-nl-popup__close {
    position: absolute !important;
    top: 8px;
    right: 12px;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    font-size: 26px !important;
    line-height: 1 !important;
    color: #888888 !important;
    cursor: pointer;
}

.sky360-nl-popup .sky360-nl-popup__close:hover {
    background: none !important;
    color: #1a1a1a !important;
}

.sky360-nl-popup .sky360-nl-popup__title {
    margin: 0 0 6px !important;
    padding: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #1a1a1a !important;
}

.sky360-nl-popup .sky360-nl-popup__intro {
    margin: 0 0 16px !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #555555 !important;
}

.sky360-nl-popup .sky360-nl-popup__name {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 1px solid #dddddd !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #1a1a1a !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    font-family: inherit;
}

.sky360-nl-popup .sky360-nl-popup__name::placeholder {
    color: #999999 !important;
}

.sky360-nl-popup .sky360-nl-popup__name.has-error {
    border-color: #dc3545 !important;
}

.sky360-nl-popup .sky360-nl-popup__captcha {
    margin: 14px 0;
    min-height: 1px;
}

.sky360-nl-popup .sky360-nl-popup__submit {
    display: block !important;
    width: 100% !important;
    margin: 4px 0 0 !important;
    padding: 13px 18px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #0073aa !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sky360-nl-popup .sky360-nl-popup__submit:hover {
    background: #005a87 !important;
    color: #ffffff !important;
}

.sky360-nl-popup .sky360-nl-popup__submit.is-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.sky360-nl-popup .sky360-nl-popup__message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 6px;
}

body.sky360-nl-popup-open {
    overflow: hidden;
}

/* Reduced Motion — disable decorative animation for users who request it */
@media (prefers-reduced-motion: reduce) {
    .sky360-newsletter-input.has-error,
    .sky360-newsletter-form.is-success,
    .sky360-newsletter-message {
        animation: none !important;
    }

    .sky360-spinner {
        animation-duration: 4s;
    }
}

/* Print */
@media print {
    .sky360-newsletter-wrapper {
        display: none;
    }
}
