/**
 * Email Subscription Modal Styles
 */

/* Ensure html and body allow full viewport */
html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Prevent body scroll when modal is active */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* Modal Container - Use ID selector for higher specificity */
#email-modal.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    display: none !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(4px) !important;
    animation: fadeIn 0.3s ease;
    overflow: hidden !important;
    transform: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

#email-modal.modal.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Modal Overlay - Click target for closing */
.modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    cursor: pointer;
    z-index: 1;
}

/* Modal Container */
.modal__container {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    z-index: 2;
}

/* Modal Close Button */
.modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.modal__close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.modal__close svg {
    color: #666;
}

/* Modal Content */
.modal__content {
    padding: 40px;
}

.modal__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal__icon svg {
    color: white;
}

.modal__title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 16px;
}

.modal__description {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    text-align: center;
    margin: 0 0 32px;
}

/* Email Form */
.email-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.form-error {
    display: block;
    font-size: 14px;
    color: #ef4444;
    margin-top: 6px;
    min-height: 20px;
}

.btn--block {
    width: 100%;
    justify-content: center;
}

.modal__privacy {
    font-size: 13px;
    color: #999;
    text-align: center;
    margin: 16px 0 0;
}

/* Subscription Messages */
.subscription-message {
    text-align: center;
    padding: 20px;
}

.subscription-message__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.subscription-message--success .subscription-message__icon {
    background: #10b981;
}

.subscription-message--success .subscription-message__icon svg {
    color: white;
}

.subscription-message--error .subscription-message__icon {
    background: #ef4444;
}

.subscription-message--error .subscription-message__icon svg {
    color: white;
}

.subscription-message__title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px;
}

.subscription-message__text {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 24px;
}

.btn--secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn--secondary:hover {
    background: #667eea;
    color: white;
}

/* Hero Email Intro */
.hero__email-intro {
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 24px;
    text-align: center;
    max-width: 500px;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal__content {
        padding: 32px 24px;
    }
    
    .modal__title {
        font-size: 24px;
    }
    
    .modal__description {
        font-size: 15px;
    }
    
    .hero__email-intro {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .modal__container {
        width: 95%;
        border-radius: 12px;
    }
    
    .modal__content {
        padding: 28px 20px;
    }
    
    .modal__title {
        font-size: 22px;
    }
    
    .modal__close {
        top: 16px;
        right: 16px;
        width: 32px;
        height: 32px;
    }
}
