/*
 * Casino Sticky Bar - Main Frontend Stylesheet
 * Version: 2.1.0
 */

/* --- Sticky Bar Styles --- */
#csb-sticky-bar {
    position: fixed !important; /* The !important tag ensures this rule overrides theme styles */
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #1a202c, #2d3748); /* Dark, modern gradient */
    color: #ffffff;
    padding: 15px 25px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transform: translateY(100%); /* Initially hidden for slide-up animation */
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.csb-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.csb-text {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.csb-button {
    background-color: #f5b301; /* Gold/Yellow - common casino color */
    color: #1a202c;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.csb-button:hover {
    background-color: #ffc940;
    transform: translateY(-2px);
}

.csb-close {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 28px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.csb-close:hover {
    color: #ffffff;
}

/* --- Modal Popup Styles --- */
#csb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 32, 44, 0.8); /* Dark semi-transparent background */
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    animation: fadeIn 0.3s ease-out forwards;
}

/* 
 * Trigger Handling Logic
 * Hide modals with advanced triggers by default.
 * JavaScript will add the .csb-is-visible class to show them when they are triggered.
 */
#csb-modal-overlay[data-csb-trigger="exit_intent"],
#csb-modal-overlay[data-csb-trigger="scroll"],
#csb-modal-overlay[data-csb-trigger="time_delay"] {
    display: none; /* Start hidden */
    animation: none; /* Don't run fade-in animation on page load */
}

#csb-modal-overlay[data-csb-trigger="exit_intent"].csb-is-visible,
#csb-modal-overlay[data-csb-trigger="scroll"].csb-is-visible,
#csb-modal-overlay[data-csb-trigger="time_delay"].csb-is-visible {
    display: flex; /* JavaScript will add this class to show the modal */
    animation: fadeIn .3s ease-out forwards; /* NOW run the animation */
}

@keyframes fadeIn {
    to {
        opacity: 1;
        visibility: visible;
    }
}

#csb-modal-content {
    background: #2d3748;
    color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    animation: scaleUp 0.3s ease-out forwards;
}

@keyframes scaleUp {
    to {
        transform: scale(1);
    }
}

.csb-modal-text {
    font-size: 22px;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 25px;
    line-height: 1.4;
}

/* Re-use the .csb-button style but make it larger in the modal */
#csb-modal-content .csb-button {
    font-size: 18px;
    padding: 12px 25px;
}

/* Position the close button inside the modal */
#csb-modal-content .csb-close {
    position: absolute;
    top: 10px;
    right: 15px;
    transform: none;
}


/* --- Responsive Styles for Smaller Screens --- */
@media (max-width: 768px) {
    #csb-sticky-bar {
        padding: 15px;
        text-align: center;
    }

    .csb-content {
        flex-direction: column;
        gap: 12px;
    }

    #csb-sticky-bar .csb-close {
        top: 10px;
        right: 10px;
        transform: none;
    }

    #csb-modal-content {
        padding: 30px 20px;
    }
}