/**
 * 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;
    flex-wrap: wrap;
}

.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: all 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: all 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);
    }
}

/* Hide form on success (optional) */
.sky360-newsletter-form.hide-on-success {
    display: none;
}

/* Responsive */
@media (max-width: 767px) {
    .sky360-newsletter-form.layout-inline {
        flex-direction: column;
    }

    .sky360-newsletter-form.layout-inline .sky360-newsletter-field {
        width: 100%;
        margin-bottom: 10px;
    }

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

/* 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;
}

/* Dark Mode Support */
.sky360-newsletter-wrapper.dark-mode .sky360-newsletter-input {
    background-color: #2d2d2d;
    border-color: #444444;
    color: #ffffff;
}

.sky360-newsletter-wrapper.dark-mode .sky360-newsletter-input::placeholder {
    color: #999999;
}

.sky360-newsletter-wrapper.dark-mode .sky360-field-icon {
    color: #999999;
}

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

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