/* Brand Popup Styles */
.brand-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: none; /* hidden by default; JS will show as flex */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.brand-popup-container {
    background-image: linear-gradient(to top, #092a63 0, #31449e 70%, #254290 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.4s ease-out;
    overflow: visible; /* ensure close button can sit outside edge */
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.brand-popup-close {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(60%, -50%); /* push slightly more to the right */
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ff4757, #ff3742);
    border-radius: 50%;
    border: 2px solid #fff;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 71, 87, 0.35);
    z-index: 1000000;
}

.brand-popup-close:hover {
    background: linear-gradient(135deg, #ff3742, #ff2f3a);
    transform: translate(60%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.6);
}

.brand-popup-close:active {
    transform: translate(60%, -50%) scale(0.95);
}

.brand-popup-header {
    text-align: center;
    margin-bottom: 25px;
}

.brand-popup-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.brand-popup-logo-img {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
}

.brand-popup-content {
    background: transparent !important;
    border-radius: 0;
    padding: 0 !important;
    margin: 0 0 25px 0;
    text-align: center;
    width: 100%;
}

.brand-popup-content-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.brand-popup-subtitle {
    color: #d4af37; /* vàng kim */
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: 5px;
    text-transform: none; /* respect user input casing */
}


.brand-popup-button {
    width: 100%;
    display: block;
    text-align: center;
    text-decoration: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0;
    line-height: 0; /* remove extra inline spacing around image */
}

.brand-popup-cta-img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    -webkit-animation: btnAnimation 1.8s ease-in-out infinite;
            animation: btnAnimation 1.8s ease-in-out infinite;
    -webkit-filter: brightness(1.2);
            filter: brightness(1.2);
    transform: scale(1.05);
    will-change: transform, filter;
    -webkit-transform: translateZ(0) scale(1.05);
}

.brand-popup-button:hover {
    text-decoration: none;
}

.brand-popup-decorations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
}

.brand-popup-chip {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #d4af37, #b8941f);
    border-radius: 50%;
    border: 2px solid #fff;
}

.brand-popup-chip.top-right {
    top: 10px;
    right: 50px;
    animation: float 3s ease-in-out infinite;
}

.brand-popup-chip.bottom-left {
    bottom: 10px;
    left: 50px;
    animation: float 3s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .brand-popup-container {
        margin: 20px;
        padding: 20px;
        max-width: none;
        width: calc(100% - 40px);
    }
    
    .brand-popup-logo-img {
        max-height: 70px;
    }
}

@-webkit-keyframes btnAnimation {
    0% {
        -webkit-filter: brightness(1.2);
                filter: brightness(1.2);
        transform: scale(1.05);
        -webkit-transform: scale(1.05);
    }
    50% {
        -webkit-filter: brightness(1);
                filter: brightness(1);
        transform: scale(1);
        -webkit-transform: scale(1);
    }
    100% {
        -webkit-filter: brightness(1.2);
                filter: brightness(1.2);
        transform: scale(1.05);
        -webkit-transform: scale(1.05);
    }
}
@keyframes btnAnimation {
    0% {
        -webkit-filter: brightness(1.2);
                filter: brightness(1.2);
        transform: scale(1.05);
        -webkit-transform: scale(1.05);
    }
    50% {
        -webkit-filter: brightness(1);
                filter: brightness(1);
        transform: scale(1);
        -webkit-transform: scale(1);
    }
    100% {
        -webkit-filter: brightness(1.2);
                filter: brightness(1.2);
        transform: scale(1.05);
        -webkit-transform: scale(1.05);
    }
}

@media (max-width: 480px) {
    .brand-popup-container {
        padding: 15px;
    }
    
    .brand-popup-logo-img {
        max-height: 56px;
    }
}
