/**
 * Newsletter Corner Popup Styles
 * Small corner teaser with owl mascot
 */

@import './variables.css';

/* === CORNER TEASER (Small Owl) === */
.newsletter-corner-teaser {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.newsletter-corner-btn {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
    position: relative;
}

.newsletter-corner-btn:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.newsletter-owl {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    order: 2;
}

.newsletter-owl img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.newsletter-speech-bubble {
    position: relative;
    background: var(--color-secondary-4);
    color: var(--color-primary);
    padding: 20px 25px;
    font-family: 'ComforterBrush', cursive;
    font-size: 32px;
    line-height: 1.2;
    white-space: nowrap;
    order: 1;
    border: 3px solid var(--color-primary);
    border-radius: 73% 27% 62% 38% / 45% 58% 42% 55%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: rotate(10deg);
}

.newsletter-speech-bubble::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid var(--color-primary);
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
}

.newsletter-speech-bubble::after {
    content: '';
    position: absolute;
    right: -9px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid var(--color-secondary-4);
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
}

.newsletter-corner-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--color-primary-alt);
    border: 2px solid var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-white);
    transition: all 0.3s ease;
}

.newsletter-corner-close:hover {
    background: #e04526;
    transform: rotate(90deg);
}

/* === EXPANDED POPUP (When Clicked) === */
.newsletter-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-4);
    backdrop-filter: blur(4px);
}

.newsletter-popup {
    background: var(--color-white);
    max-width: 450px;
    width: 100%;
    padding: var(--spacing-8);
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius-xl);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.newsletter-popup-show {
    transform: scale(1);
    opacity: 1;
}

/* Close Button */
.newsletter-popup-close {
    position: absolute;
    top: var(--spacing-4);
    right: var(--spacing-4);
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--color-primary-lighter);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.newsletter-popup-close:hover {
    background: var(--color-primary-lighter);
    color: var(--color-white);
}

/* Content */
.newsletter-popup-content {
    text-align: center;
}

.newsletter-owl-large {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-6);
}

.newsletter-owl-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.newsletter-popup-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-xxl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin: 0 0 var(--spacing-4) 0;
    line-height: 1.2;
}

.newsletter-popup-description {
    font-family: var(--font-tertiary);
    font-size: var(--font-size-base);
    color: var(--color-primary-lighter);
    margin: 0 0 var(--spacing-6) 0;
    line-height: 1.6;
}

/* Form */
.newsletter-popup-form {
    margin-bottom: var(--spacing-4);
}

.newsletter-popup-input {
    width: 100%;
    padding: var(--spacing-4);
    border: 2px solid var(--color-border);
    border-radius: 0;
    font-family: var(--font-tertiary);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-4);
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.newsletter-popup-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.newsletter-popup-input[readonly] {
    background: var(--color-border-light);
    cursor: not-allowed;
}

.newsletter-popup-submit {
    width: 100%;
    padding: var(--spacing-4) var(--spacing-6);
    background: var(--color-primary-alt);
    color: var(--color-white);
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-tertiary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
}

.newsletter-popup-submit:hover:not(:disabled) {
    background: #e04526;
}

.newsletter-popup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.newsletter-popup-message {
    padding: var(--spacing-4);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-4);
    font-family: var(--font-tertiary);
    font-size: var(--font-size-base);
}

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

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

/* Privacy Link */
.newsletter-popup-privacy {
    font-family: var(--font-tertiary);
    font-size: var(--font-size-xs);
    color: var(--color-primary-lighter);
    margin: 0;
}

/* Body class when popup is open */
body.newsletter-popup-open {
    overflow: hidden;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .newsletter-corner-teaser {
        bottom: 15px;
        right: 15px;
    }

    .newsletter-corner-btn {
        max-width: calc(100vw - 40px);
        gap: var(--spacing-1);
    }

    .newsletter-owl {
        width: 80px;
        height: 80px;
    }

    .newsletter-speech-bubble {
        font-size: 24px;
        padding: 15px 20px;
    }

    .newsletter-speech-bubble::before {
        right: -12px;
        border-left-width: 15px;
        border-top-width: 12px;
        border-bottom-width: 12px;
    }

    .newsletter-speech-bubble::after {
        right: -7px;
        border-left-width: 12px;
        border-top-width: 9px;
        border-bottom-width: 9px;
    }

    .newsletter-popup {
        padding: var(--spacing-6);
        max-width: calc(100% - var(--spacing-8));
    }

    .newsletter-owl-large {
        width: 90px;
        height: 90px;
        margin-bottom: var(--spacing-4);
    }

    .newsletter-popup-title {
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-3);
    }

    .newsletter-popup-description {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-4);
    }

    .newsletter-popup-input,
    .newsletter-popup-submit {
        padding: var(--spacing-3);
        font-size: var(--font-size-sm);
    }

    .newsletter-popup-close {
        top: var(--spacing-2);
        right: var(--spacing-2);
        width: 32px;
        height: 32px;
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .newsletter-owl {
        width: 60px;
        height: 60px;
    }

    .newsletter-speech-bubble {
        font-size: 20px;
        padding: 12px 16px;
        max-width: 140px;
        white-space: normal;
        line-height: 1.3;
    }

    .newsletter-speech-bubble::before {
        right: -10px;
        border-left-width: 12px;
        border-top-width: 10px;
        border-bottom-width: 10px;
    }

    .newsletter-speech-bubble::after {
        right: -6px;
        border-left-width: 10px;
        border-top-width: 7px;
        border-bottom-width: 7px;
    }
}
