:root {
    --primary: hsl(16, 90%, 55%);
    --primary-dark: hsl(16, 90%, 45%);
    --secondary: hsl(174, 62%, 47%);
    --background: hsl(0, 0%, 98%);
    --foreground: hsl(222, 47%, 11%);
    --card: hsl(0, 0%, 100%);
    --border: hsl(214, 32%, 91%);
    --border-dark: hsl(214, 30%, 85%);
    --muted: hsl(210, 40%, 96%);
    --muted-foreground: hsl(215, 16%, 47%);
    --success: hsl(142, 71%, 45%);
    --warning: hsl(38, 92%, 50%);
    --destructive: hsl(0, 84%, 60%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.2);
}

/* ===============================
POPUP OVERLAY
=============================== */
#marketing-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

/* ===============================
POPUP CONTAINER
=============================== */
.popup-content {
    background: var(--card);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: popupSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    padding: 0 0 16px 0; /* Add padding at bottom */
}

/* ===============================
ANIMATIONS
=============================== */
@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===============================
IMAGE SECTION - Updated to match HTML
=============================== */
#popup-image {
    width: 100%;
    height: auto;
    max-height: 270px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Add a container effect using the image itself */
.popup-content:has(#popup-image) #popup-image {
    aspect-ratio: 16/9;
}

/* Loading state for image */
#popup-image[src=""] {
    display: none;
}

/* ===============================
TITLE - Direct element styling
=============================== */
#popup-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--foreground);
    margin: 24px 28px 12px 28px; /* Add horizontal margin */
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* ===============================
DESCRIPTION - Direct element styling
=============================== */
#popup-description {
    font-size: 15px;
    color: var(--muted-foreground);
    line-height: 1.6;
    margin: 5px 28px 24px 28px; /* Add horizontal margin */
    max-height: 80px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom scrollbar for description */
#popup-description::-webkit-scrollbar {
    width: 4px;
}

#popup-description::-webkit-scrollbar-track {
    background: var(--muted);
    border-radius: 4px;
}

#popup-description::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* ===============================
BUTTON - Direct element styling
=============================== */
#popup-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 56px); /* Account for margins */
    margin: 0 28px; /* Match title/description margins */
    background: var(--primary);
    color: white;
    padding: 16px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

/* Add arrow icon using pseudo-element */
#popup-button::after {
    content: '→';
    font-size: 20px;
    transition: transform 0.2s ease;
    margin-left: 4px;
}

#popup-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

#popup-button:hover::after {
    transform: translateX(4px);
}

#popup-button:active {
    transform: translateY(0);
}

/* Shine effect on button */
#popup-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

#popup-button:hover::before {
    left: 100%;
}

/* ===============================
CLOSE BUTTON - Direct element styling
=============================== */
#popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    color: var(--foreground);
    box-shadow: var(--shadow-md);
    z-index: 10;
    transition: all 0.2s ease;
    border: none;
    line-height: 1;
    opacity: 0.9;
}

#popup-close:hover {
    background: var(--destructive);
    color: white;
    transform: rotate(90deg);
    opacity: 1;
}

/* ===============================
NO IMAGE STYLES
=============================== */
.popup-content:not(:has(#popup-image[src])) #popup-title {
    margin-top: 40px;
}

/* ===============================
RESPONSIVE DESIGN
=============================== */

/* Tablet */
@media (max-width: 768px) {
    .popup-content {
        max-width: 420px;
    }
    
    #popup-title {
        font-size: 22px;
        margin: 20px 24px 10px 24px;
    }
    
    #popup-description {
        margin: 0 24px 20px 24px;
    }
    
    #popup-button {
        width: calc(100% - 48px);
        margin: 0 24px;
        padding: 14px 24px;
    }
}
