/**
 * Port Trust & Announcements - Announcement Popup Styles
 * Clean, non-intrusive marketing popup
 */

/* =====================================================
   POPUP CONTAINER
   ===================================================== */

.pta-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
}

.pta-popup.pta-visible {
    pointer-events: auto;
}

/* Backdrop - very subtle */
.pta-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pta-popup.pta-visible .pta-popup-backdrop {
    opacity: 1;
}

/* =====================================================
   POPUP CONTAINER
   ===================================================== */

.pta-popup-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pta-popup.pta-visible .pta-popup-container {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.pta-popup.pta-hiding .pta-popup-container {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s ease-in;
}

/* =====================================================
   CLOSE BUTTON
   ===================================================== */

.pta-popup-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.pta-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* =====================================================
   POPUP CONTENT
   ===================================================== */

.pta-popup-content {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* Image section */
.pta-popup-image {
    flex-shrink: 0;
    width: 160px;
    min-width: 160px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
}

.pta-popup-image img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
}

/* Text section */
.pta-popup-text {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Title */
.pta-popup-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Body text */
.pta-popup-body {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* =====================================================
   CTA BUTTON
   ===================================================== */

.pta-popup-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
}

.pta-popup-cta:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.35);
    color: #fff;
    text-decoration: none;
}

.pta-popup-cta:active {
    transform: translateY(0);
}

/* =====================================================
   MOBILE RESPONSIVE
   ===================================================== */

@media (max-width: 480px) {
    .pta-popup {
        padding: 15px;
        align-items: flex-end;
    }

    .pta-popup-container {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .pta-popup.pta-visible .pta-popup-container {
        transform: translateY(0);
    }

    .pta-popup.pta-hiding .pta-popup-container {
        transform: translateY(100%);
    }

    .pta-popup-content {
        flex-direction: column;
    }

    .pta-popup-image {
        width: 100%;
        height: auto;
        padding: 15px;
        background: #f8f9fa;
    }

    .pta-popup-image img {
        max-height: 140px;
        width: auto;
        max-width: 100%;
        margin: 0 auto;
        display: block;
    }

    .pta-popup-text {
        padding: 20px;
    }

    .pta-popup-title {
        font-size: 16px;
    }

    .pta-popup-body {
        font-size: 13px;
    }

    .pta-popup-close {
        top: 10px;
        left: 10px;
        width: 28px;
        height: 28px;
        font-size: 18px;
        background: rgba(255, 255, 255, 0.9);
    }
}

/* =====================================================
   RTL SUPPORT
   ===================================================== */

[dir="rtl"] .pta-popup-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .pta-popup-text {
    text-align: right;
}

[dir="rtl"] .pta-popup-close {
    left: auto;
    right: 12px;
}

@media (max-width: 480px) {
    [dir="rtl"] .pta-popup-content {
        flex-direction: column;
    }
    
    [dir="rtl"] .pta-popup-close {
        right: 10px;
    }
}

/* =====================================================
   NO IMAGE VARIANT
   ===================================================== */

.pta-popup-content:not(:has(.pta-popup-image)) {
    flex-direction: column;
}

.pta-popup-content:not(:has(.pta-popup-image)) .pta-popup-text {
    padding: 28px;
}

/* Fallback for browsers without :has() */
.pta-popup-no-image .pta-popup-content {
    flex-direction: column;
}

.pta-popup-no-image .pta-popup-text {
    padding: 28px;
}

/* =====================================================
   ANIMATION STATES
   ===================================================== */

@keyframes pta-popup-pulse {
    0%, 100% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2), 0 10px 30px rgba(0, 0, 0, 0.12);
    }
}

.pta-popup.pta-visible .pta-popup-container {
    animation: pta-popup-pulse 2s ease-in-out infinite;
    animation-delay: 0.5s;
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */

.pta-popup-close:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.pta-popup-cta:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .pta-popup-container {
        transition: opacity 0.2s ease;
        transform: none !important;
    }

    .pta-popup.pta-visible .pta-popup-container {
        animation: none;
    }
}
