/**
 * High Roller Gift Offers - Public Styles
 * Version: 1.5.0
 */

/* === GIFT ICON === */

/* Desktop: inline after menu items */
.hgo-gift-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.hgo-gift-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    margin: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.hgo-gift-icon:hover {
    transform: scale(1.08);
}

.hgo-gift-icon img,
.hgo-gift-icon svg {
    width: 38px;
    height: 38px;
    display: block;
    pointer-events: none;
}

.hgo-gift-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
    line-height: 1;
}

/* Desktop: flex alignment in Mercury header */
@media (min-width: 1200px) {
    .space-header-menu.box-75.left.relative {
        display: flex;
        align-items: center;
    }

    .hgo-gift-icon-wrapper {
        margin-left: auto;
        margin-right: 10px;
    }
}

/* === Mobile/Tablet: absolute next to burger ===
   Burger: top:20px, right:15px, w:24px, h:~20px → center-Y=30px
   Gift icon anchored to same center-Y, to the left of burger */
@media (max-width: 1199px) {
    .hgo-gift-icon-wrapper {
        position: absolute;
        top: 30px;
        transform: translateY(-50%);
        right: 50px;
        z-index: 10;
    }
}

@media (max-width: 991px) {
    .hgo-gift-icon img,
    .hgo-gift-icon svg {
        width: 34px;
        height: 34px;
    }
}

/* === PANEL === */
#hgo-panel {
    position: fixed;
    top: var(--hgo-panel-top, 70px);
    right: var(--hgo-panel-right, 10px);
    width: 420px;
    max-width: calc(100vw - 20px);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
}

#hgo-panel.hgo-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Triangle Arrow - pointing UP, positioned via CSS var from JS */
#hgo-panel::before {
    content: '';
    position: absolute;
    top: -12px;
    right: var(--hgo-arrow-right, 30px);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid var(--hgo-border, #1a1a2e);
}

/* === CLOSE BUTTON === */
#hgo-panel .hgo-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #555;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: #fff;
}

#hgo-panel .hgo-close:hover {
    background: #333;
}

/* === OFFERS CONTAINER === */
#hgo-panel .hgo-offers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* === SINGLE OFFER === */
#hgo-panel .hgo-offer {
    background: var(--hgo-bg, #1a1a2e);
    border: 2px solid var(--hgo-border, #1a1a2e);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Top row: logo + text */
#hgo-panel .hgo-offer-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#hgo-panel .hgo-logo {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

#hgo-panel .hgo-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: transparent;
}

#hgo-panel .hgo-text {
    color: var(--hgo-text, #ffffff);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;
}

#hgo-panel .hgo-casino-name {
    font-weight: 700;
    opacity: 0.65;
}

/* Bottom row: promo code + button side by side */
#hgo-panel .hgo-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

#hgo-panel .hgo-btn {
    flex-shrink: 0;
    padding: 7px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#hgo-panel .hgo-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
    text-decoration: none;
}

/* === PROMO CODE === */
#hgo-panel .hgo-promo {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    border: 1px dashed var(--hgo-border, #1a1a2e);
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

#hgo-panel .hgo-promo:hover {
    background: rgba(255,255,255,0.12);
}

#hgo-panel .hgo-hidden-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
    width: 0;
    height: 0;
}

#hgo-panel .hgo-promo-code {
    color: var(--hgo-promo, #ffffff);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#hgo-panel .hgo-copy-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--hgo-promo, #ffffff);
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

#hgo-panel .hgo-copy-btn:hover {
    opacity: 1;
}

/* Copied state */
#hgo-panel .hgo-promo.copied {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
}

#hgo-panel .hgo-promo.copied .hgo-promo-code {
    color: #4CAF50;
}

#hgo-panel .hgo-promo.copied .hgo-copy-btn {
    color: #4CAF50;
    opacity: 1;
}

#hgo-panel .hgo-copy-check {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Copy tooltip */
.hgo-copy-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    z-index: 9999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.hgo-copy-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.hgo-copy-tooltip svg {
    width: 24px;
    height: 24px;
    fill: #4CAF50;
}

/* === MOBILE === */
@media (max-width: 575px) {
    #hgo-panel {
        left: 10px;
        right: 10px !important;
        width: auto;
    }

    #hgo-panel .hgo-offer {
        padding: 8px;
    }

    #hgo-panel .hgo-text {
        font-size: 11px;
    }
}

/* === WIGGLE ANIMATION === */
@keyframes hgoWiggle {
    0%, 3%, 100% { transform: rotate(0); }
    0.5% { transform: rotate(-10deg); }
    1% { transform: rotate(8deg); }
    1.5% { transform: rotate(-6deg); }
    2% { transform: rotate(4deg); }
    2.5% { transform: rotate(-2deg); }
}

.hgo-gift-icon {
    animation: hgoWiggle 10s ease-in-out infinite;
}
