/**
 * Starter Developer Theme - Popup Styles
 */

/* ====================================
   POPUP BASE STYLES
   ==================================== */
.starter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.starter-popup[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

/* ====================================
   OVERLAY
   ==================================== */
.starter-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ====================================
   CONTAINER
   ==================================== */
.starter-popup__container {
    position: relative;
    background: var(--starter-card-bg, #fff);
    border-radius: var(--starter-radius-lg, 16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.starter-popup[aria-hidden="false"] .starter-popup__container {
    transform: scale(1) translateY(0);
}

/* ====================================
   CLOSE BUTTON
   ==================================== */
.starter-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: var(--starter-background, #f8f9fa);
    border: none;
    border-radius: var(--starter-radius-full, 50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--starter-transition, all 0.2s ease);
}

.starter-popup__close svg {
    width: 18px;
    height: 18px;
    color: var(--starter-text-secondary, #6b7280);
}

.starter-popup__close:hover {
    background: var(--starter-error, #ef4444);
}

.starter-popup__close:hover svg {
    color: #fff;
}

/* ====================================
   CONTENT AREA
   ==================================== */
.starter-popup__content {
    display: flex;
    flex-direction: column;
}

.starter-popup__image {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
}

.starter-popup__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.starter-popup__body {
    padding: var(--starter-spacing-xl, 32px);
    text-align: center;
}

.starter-popup__title {
    font-size: var(--starter-font-size-2xl, 28px);
    font-weight: 700;
    color: var(--starter-text-primary, #111827);
    margin: 0 0 var(--starter-spacing-md, 16px);
    line-height: 1.2;
}

.starter-popup__text {
    font-size: var(--starter-font-size-base, 16px);
    color: var(--starter-text-secondary, #6b7280);
    margin-bottom: var(--starter-spacing-lg, 24px);
    line-height: 1.6;
}

/* ====================================
   COUPON SECTION
   ==================================== */
.starter-popup__coupon {
    background: var(--starter-background, #f8f9fa);
    border-radius: var(--starter-radius, 12px);
    padding: var(--starter-spacing-md, 16px);
    margin-bottom: var(--starter-spacing-lg, 24px);
}

.starter-popup__coupon-text {
    font-size: var(--starter-font-size-sm, 14px);
    color: var(--starter-text-secondary, #6b7280);
    margin: 0 0 var(--starter-spacing-sm, 8px);
}

.starter-popup__coupon-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--starter-spacing-sm, 8px);
}

.starter-popup__coupon-code code {
    background: var(--starter-primary, #2563eb);
    color: #fff;
    font-size: var(--starter-font-size-lg, 18px);
    font-weight: 700;
    padding: var(--starter-spacing-sm, 8px) var(--starter-spacing-md, 16px);
    border-radius: var(--starter-radius-sm, 6px);
    letter-spacing: 2px;
}

.starter-popup__copy-coupon {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--starter-card-bg, #fff);
    border: 1px solid var(--starter-border-color, #e5e7eb);
    border-radius: var(--starter-radius-sm, 6px);
    padding: var(--starter-spacing-sm, 8px) var(--starter-spacing-md, 16px);
    font-size: var(--starter-font-size-sm, 14px);
    color: var(--starter-text-secondary, #6b7280);
    cursor: pointer;
    transition: var(--starter-transition, all 0.2s ease);
}

.starter-popup__copy-coupon:hover {
    border-color: var(--starter-primary, #2563eb);
    color: var(--starter-primary, #2563eb);
}

.starter-popup__copy-coupon.copied {
    background: var(--starter-success, #10b981);
    border-color: var(--starter-success, #10b981);
    color: #fff;
}

/* ====================================
   NEWSLETTER SECTION
   ==================================== */
.starter-popup__newsletter {
    margin-bottom: var(--starter-spacing-lg, 24px);
}

.starter-popup__newsletter-text {
    font-size: var(--starter-font-size-sm, 14px);
    color: var(--starter-text-secondary, #6b7280);
    margin: 0 0 var(--starter-spacing-sm, 8px);
}

.starter-popup__newsletter-form {
    display: flex;
    gap: var(--starter-spacing-sm, 8px);
}

.starter-popup__newsletter-form input[type="email"] {
    flex: 1;
    padding: var(--starter-spacing-sm, 8px) var(--starter-spacing-md, 16px);
    border: 1px solid var(--starter-border-color, #e5e7eb);
    border-radius: var(--starter-radius, 12px);
    font-size: var(--starter-font-size-base, 16px);
    outline: none;
    transition: var(--starter-transition, all 0.2s ease);
}

.starter-popup__newsletter-form input[type="email"]:focus {
    border-color: var(--starter-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.starter-popup__newsletter-form button {
    white-space: nowrap;
}

.starter-popup__newsletter-success {
    color: var(--starter-success, #10b981);
    font-weight: 600;
    padding: var(--starter-spacing-md, 16px);
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--starter-radius, 12px);
}

/* ====================================
   ACTIONS
   ==================================== */
.starter-popup__actions {
    display: flex;
    justify-content: center;
    gap: var(--starter-spacing-sm, 8px);
}

.starter-popup__button {
    padding: var(--starter-spacing-md, 16px) var(--starter-spacing-xl, 32px);
    font-size: var(--starter-font-size-base, 16px);
    min-width: 150px;
}

/* ====================================
   STYLE VARIANTS
   ==================================== */

/* Slide from bottom */
.starter-popup--slide-up .starter-popup__container {
    transform: scale(1) translateY(100%);
}

.starter-popup--slide-up[aria-hidden="false"] .starter-popup__container {
    transform: scale(1) translateY(0);
}

/* Slide from left */
.starter-popup--slide-left {
    justify-content: flex-start;
}

.starter-popup--slide-left .starter-popup__container {
    transform: translateX(-100%);
    margin-left: 20px;
    border-radius: 0 var(--starter-radius-lg, 16px) var(--starter-radius-lg, 16px) 0;
    max-height: 100vh;
}

.starter-popup--slide-left[aria-hidden="false"] .starter-popup__container {
    transform: translateX(0);
}

/* Slide from right */
.starter-popup--slide-right {
    justify-content: flex-end;
}

.starter-popup--slide-right .starter-popup__container {
    transform: translateX(100%);
    margin-right: 20px;
    border-radius: var(--starter-radius-lg, 16px) 0 0 var(--starter-radius-lg, 16px);
    max-height: 100vh;
}

.starter-popup--slide-right[aria-hidden="false"] .starter-popup__container {
    transform: translateX(0);
}

/* Fullscreen */
.starter-popup--fullscreen .starter-popup__container {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.starter-popup--fullscreen .starter-popup__content {
    max-width: 600px;
}

/* Bottom bar */
.starter-popup--bottom-bar {
    align-items: flex-end;
}

.starter-popup--bottom-bar .starter-popup__overlay {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.starter-popup--bottom-bar .starter-popup__container {
    max-width: 100%;
    width: 100%;
    border-radius: var(--starter-radius-lg, 16px) var(--starter-radius-lg, 16px) 0 0;
    transform: translateY(100%);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

.starter-popup--bottom-bar[aria-hidden="false"] .starter-popup__container {
    transform: translateY(0);
}

.starter-popup--bottom-bar .starter-popup__body {
    padding: var(--starter-spacing-lg, 24px);
}

.starter-popup--bottom-bar .starter-popup__content {
    flex-direction: row;
    align-items: center;
    gap: var(--starter-spacing-lg, 24px);
}

.starter-popup--bottom-bar .starter-popup__image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: var(--starter-radius, 12px);
    max-height: none;
}

.starter-popup--bottom-bar .starter-popup__body {
    text-align: left;
    flex: 1;
}

.starter-popup--bottom-bar .starter-popup__title {
    font-size: var(--starter-font-size-xl, 20px);
}

.starter-popup--bottom-bar .starter-popup__actions {
    justify-content: flex-start;
}

/* Top bar */
.starter-popup--top-bar {
    align-items: flex-start;
}

.starter-popup--top-bar .starter-popup__overlay {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.starter-popup--top-bar .starter-popup__container {
    max-width: 100%;
    width: 100%;
    border-radius: 0 0 var(--starter-radius-lg, 16px) var(--starter-radius-lg, 16px);
    transform: translateY(-100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.starter-popup--top-bar[aria-hidden="false"] .starter-popup__container {
    transform: translateY(0);
}

.starter-popup--top-bar .starter-popup__content {
    flex-direction: row;
    align-items: center;
    gap: var(--starter-spacing-lg, 24px);
}

.starter-popup--top-bar .starter-popup__body {
    text-align: left;
    padding: var(--starter-spacing-lg, 24px);
    flex: 1;
}

.starter-popup--top-bar .starter-popup__title {
    font-size: var(--starter-font-size-xl, 20px);
}

/* ====================================
   MOBILE RESPONSIVE
   ==================================== */
@media (max-width: 768px) {
    .starter-popup__container {
        width: 95%;
        max-height: 95vh;
    }
    
    .starter-popup__body {
        padding: var(--starter-spacing-lg, 24px);
    }
    
    .starter-popup__title {
        font-size: var(--starter-font-size-xl, 20px);
    }
    
    .starter-popup__newsletter-form {
        flex-direction: column;
    }
    
    .starter-popup__newsletter-form button {
        width: 100%;
    }
    
    .starter-popup--bottom-bar .starter-popup__content,
    .starter-popup--top-bar .starter-popup__content {
        flex-direction: column;
    }
    
    .starter-popup--bottom-bar .starter-popup__image,
    .starter-popup--top-bar .starter-popup__image {
        width: 100%;
        height: auto;
        max-height: 150px;
    }
    
    .starter-popup--bottom-bar .starter-popup__body,
    .starter-popup--top-bar .starter-popup__body {
        text-align: center;
    }
    
    .starter-popup--bottom-bar .starter-popup__actions,
    .starter-popup--top-bar .starter-popup__actions {
        justify-content: center;
    }
    
    .starter-popup--slide-left .starter-popup__container,
    .starter-popup--slide-right .starter-popup__container {
        margin: 0;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .starter-popup__coupon-code {
        flex-direction: column;
    }
}

/* ====================================
   ANIMATIONS
   ==================================== */
@keyframes popup-shake {
    0%, 100% { transform: scale(1) translateX(0); }
    25% { transform: scale(1) translateX(-5px); }
    75% { transform: scale(1) translateX(5px); }
}

.starter-popup--shake .starter-popup__container {
    animation: popup-shake 0.4s ease;
}

@keyframes popup-pulse {
    0%, 100% { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
    50% { box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.4); }
}

.starter-popup--attention .starter-popup__container {
    animation: popup-pulse 1.5s ease infinite;
}

/* ====================================
   BODY SCROLL LOCK
   ==================================== */
body.starter-popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Preserve scroll position when popup opens */
body.starter-popup-open #page {
    position: relative;
}