/* Newsletter Global Styles for Index Page */

/* Newsletter Overlay - Hidden by default */
#newsletter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none !important; /* Hidden by default with !important */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
}

/* Show newsletter overlay when active */
#newsletter-overlay.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: fadeIn 0.3s ease;
}

#newsletter-popup {
    background: #ffffff;
    border-radius: 0;
    padding: 32px;
    max-width: 500px;
    width: 500px;
    height: 500px;
    max-height: 90vh;
    position: relative;
    animation: slideIn 0.3s ease;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.newsletter-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.newsletter-close:hover {
    background: #e0e0e0;
    color: #000;
}

.newsletter-popup-title {
    font-size: 1.85rem;
    font-weight: 300;
    color: #000;
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.2;
}

.newsletter-popup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.newsletter-email-label {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
}

.newsletter-popup-email {
    width: 100%;
    max-width: 100%;
    padding: 16px 20px;
    border: 2px solid #9e9e9ecc;
    border-radius: 0;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: white;
    color: #000;
    box-sizing: border-box;
}

.newsletter-popup-email:focus {
    outline: none;
    border-color: #25303C;
    transform: translateY(-1px);
}

.newsletter-popup-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.newsletter-popup-checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.newsletter-popup-checkbox label {
    font-size: 0.875rem;
    color: #333;
    line-height: 1.5;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.newsletter-popup-checkbox input[type="checkbox"]:focus {
    outline: 2px solid #25303C;
    outline-offset: 2px;
}

.newsletter-popup-submit {
    width: 100%;
    background: #25303C;
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 0;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.newsletter-popup-submit:hover {
    transform: translateY(-2px);
}

.newsletter-popup-submit:hover .btn-icon {
    transform: translateX(4px);
}

.btn-icon {
    transition: transform 0.3s ease;
    font-size: 1.5em;
}

.newsletter-popup-loading {
    display: none;
    text-align: center;
    color: #666;
    font-size: 0.875rem;
}

.newsletter-popup-loading.show {
    display: block;
}

.newsletter-popup-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #25303C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

.newsletter-popup-success,
.newsletter-popup-error {
    display: none;
    text-align: center;
    padding: 12px;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.newsletter-popup-success.show {
    display: block;
    background: rgba(183, 102, 102, 0.1);
    color: #25303C;
    border: 1px solid rgba(183, 102, 102, 0.2);
}

.newsletter-popup-error.show {
    display: block;
    background: rgba(183, 102, 102, 0.1);
    color: #25303C;
    border: 1px solid rgba(183, 102, 102, 0.2);
}

.newsletter-popup-privacy {
    font-size: 1rem;
    color: #666;
    text-align: center;
    line-height: 1.4;
    margin-top: 8px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
    #newsletter-popup {
        padding: 24px 20px;
        margin: 20px;
    }
    
    .newsletter-popup-title {
        font-size: 1.125rem;
    }
}
