/**
 * CVEDNA Newsletter - Frontend Styles
 * Modern, responsive, production-ready styles
 */

/* Base Form Styles */
.cvedna-newsletter-form-wrapper {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cvedna-newsletter-form {
    width: 100%;
}

.cvedna-newsletter-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(171, 163, 163, 0.05);
    color: #08bb0e;
    transition: all 0.3s ease;
    outline: none;
}

.cvedna-newsletter-input:focus {
    border-color: #ef4444;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.cvedna-newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.cvedna-newsletter-email-wrapper {
    position: relative;
    display: flex;
    gap: 8px;
}

.cvedna-newsletter-button {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #ef4444;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    white-space: nowrap;
}

.cvedna-newsletter-button:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.cvedna-newsletter-button:active:not(:disabled) {
    transform: translateY(0);
}

.cvedna-newsletter-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cvedna-newsletter-spinner {
    width: 20px;
    height: 20px;
    animation: cvedna-spin 1s linear infinite;
}

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

/* Messages */
.cvedna-newsletter-message {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    animation: cvedna-slide-in 0.3s ease;
}

@keyframes cvedna-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cvedna-newsletter-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.cvedna-newsletter-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* GDPR Consent */
.cvedna-newsletter-gdpr {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.cvedna-newsletter-gdpr input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.cvedna-newsletter-gdpr a {
    color: #ef4444;
    text-decoration: none;
    transition: color 0.2s;
}

.cvedna-newsletter-gdpr a:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* Name Fields */
.cvedna-newsletter-name-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

/* Style Variants */

/* Inline Style */
.cvedna-newsletter-form[data-style="inline"] .cvedna-newsletter-email-wrapper {
    flex-direction: row;
}

.cvedna-newsletter-form[data-style="inline"] .cvedna-newsletter-email {
    flex: 1;
}

/* Minimal Style */
.cvedna-newsletter-form[data-style="minimal"] {
    max-width: 400px;
}

.cvedna-newsletter-form[data-style="minimal"] .cvedna-newsletter-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    padding: 8px 0;
}

.cvedna-newsletter-form[data-style="minimal"] .cvedna-newsletter-input:focus {
    border-bottom-color: #ef4444;
    box-shadow: none;
}

.cvedna-newsletter-form[data-style="minimal"] .cvedna-newsletter-button {
    border-radius: 0;
    width: 100%;
    margin-top: 16px;
}

/* Card Style */
.cvedna-newsletter-form[data-style="card"] {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
}

.cvedna-newsletter-form[data-style="card"] .cvedna-newsletter-email-wrapper {
    flex-direction: column;
}

.cvedna-newsletter-form[data-style="card"] .cvedna-newsletter-button {
    width: 100%;
}

/* Responsive */
@media (max-width: 640px) {
    .cvedna-newsletter-email-wrapper {
        flex-direction: column;
    }

    .cvedna-newsletter-button {
        width: 100%;
    }

    .cvedna-newsletter-name-fields {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.cvedna-newsletter-form.loading .cvedna-newsletter-button-text {
    display: none;
}

.cvedna-newsletter-form.loading .cvedna-newsletter-button-loading {
    display: block !important;
}

/* Success State Animation */
.cvedna-newsletter-form.success .cvedna-newsletter-email-wrapper {
    animation: cvedna-success-pulse 0.5s ease;
}

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

/* Focus-visible for accessibility */
.cvedna-newsletter-input:focus-visible {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

.cvedna-newsletter-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Dark theme support (if needed) */
@media (prefers-color-scheme: light) {
    .cvedna-newsletter-input {
        background: rgba(0, 0, 0, 0.05);
        color: #1a1a1a;
        border-color: rgba(0, 0, 0, 0.1);
    }

    .cvedna-newsletter-input::placeholder {
        color: rgba(0, 0, 0, 0.4);
    }

    .cvedna-newsletter-gdpr {
        color: rgba(0, 0, 0, 0.6);
    }
}

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