/**
 * MailerLite Popup Styles
 */

/* Overlay - Black background */
.mlp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mlp-overlay.mlp-visible {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.mlp-popup {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.mlp-overlay.mlp-visible .mlp-popup {
    transform: scale(1) translateY(0);
}

/* Close Button */
.mlp-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    color: inherit;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mlp-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.mlp-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Two Column Layout */
.mlp-container {
    display: flex;
    min-height: 500px;
}

/* Left Side - Image */
.mlp-left {
    width: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.mlp-left.mlp-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Right Side - Content */
.mlp-right {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

.mlp-content {
    width: 100%;
    max-width: 320px;
}

/* Header */
.mlp-header {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

/* Logo */
.mlp-logo {
    margin-bottom: 20px;
}

.mlp-logo img {
    display: inline-block;
    height: auto;
}

/* Description */
.mlp-description {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 24px 0;
    opacity: 0.85;
}

/* Form */
.mlp-form {
    width: 100%;
}

.mlp-form-group {
    margin-bottom: 16px;
}

.mlp-form input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mlp-form input[type="email"]:focus {
    outline: none;
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.mlp-form input[type="email"]::placeholder {
    color: #999;
}

/* Submit Button */
.mlp-submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.mlp-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mlp-submit:active {
    transform: translateY(0);
}

.mlp-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Message */
.mlp-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.mlp-message.mlp-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mlp-message.mlp-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading State */
.mlp-loading .mlp-submit {
    position: relative;
    color: transparent;
}

.mlp-loading .mlp-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: mlp-spin 0.8s linear infinite;
}

@keyframes mlp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mlp-popup {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .mlp-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .mlp-left {
        width: 100%;
        height: 200px;
        min-height: 200px;
    }
    
    .mlp-right {
        width: 100%;
        padding: 30px 24px;
    }
    
    .mlp-content {
        max-width: 100%;
    }
    
    .mlp-header {
        font-size: 24px;
    }
    
    .mlp-description {
        font-size: 15px;
    }
    
    .mlp-close {
        top: 10px;
        right: 10px;
        background: rgba(255, 255, 255, 0.9);
        color: #333;
    }
}

@media (max-width: 480px) {
    .mlp-popup {
        border-radius: 8px;
    }
    
    .mlp-left {
        height: 230px;
        min-height: 230px;
    }
    
    .mlp-right {
        padding: 24px 20px;
    }
    
    .mlp-header {
        font-size: 22px;
    }
    
    .mlp-form input[type="email"],
    .mlp-submit {
        padding: 12px 14px;
        font-size: 15px;
    }
}

/* Animation for success state */
.mlp-form.mlp-subscribed {
    animation: mlp-fade-out 0.3s ease forwards;
}

@keyframes mlp-fade-out {
    to {
        opacity: 0;
        height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
}
