
/* ============================= */
/*           MAIN/JACKPOT       */
/* ============================= */

:root {
    /* Base Neutrals */
    --bg-white: #ffffff;                        /* Pure White */
    --text-main: #1c1c1c;                       /* Charcoal Black */
    --text-muted: #6e6e6e;                      /* Mid Gray */
    --input-bg-default: #f5f5f5;                /* Light Gray */
    --input-bg-secondary: #eaeaea;              /* Slightly Darker Gray */
    --input-border: #cccccc;                    /* Standard Gray Border */
    --card-shadow: rgba(0, 0, 0, 0.05);          /* Subtle Shadow */
    --card-shadow-hover: rgba(0, 0, 0, 0.15);    /* Deeper Shadow on Hover */
    --input-focus-outline: #999999;             /* Soft Focus Gray */

    /* Buttons */
    --btn-add-to-cart-bg: #e4bc1c;              /* Dark Neutral Button */
    --btn-add-to-cart-bg-hover: #bf9d17;        /* Slightly Lighter Hover */
    --btn-disabled-bg: #bfbfbf;                 /* Disabled State Gray */

    /* Price & Status Indicators */
    --price-badge-bg: rgba(0, 0, 0, 0.05);       /* Faint Gray Badge */
    --price-sold-out: #a33a3a;                  /* Muted Red for Status */
    --sold-out-color: #a33a3a;                  /* Same for Consistency */
    --sold-out-btn-bg: #d6d6d6;                 /* Muted Out Button */
    --bright-red: #e63946;

    /* Progress Bar */
    --progress-bg: #dcdcdc;
    --progress-bar-bg: #dcdcdc;
    --progress-bar-color: #4a4a4a;

    /* Pagination */
    --pagination-btn-bg: #f0f0f0;
    --pagination-btn-hover-bg: #d9d9d9;

    /* Popups & Overlays */
    --popup-bg: #ffffff;
    --popup-overlay-bg: rgba(0, 0, 0, 0.4);

    /* Accent / Placeholder */
    --jackpot-color: #000000;
    --raffle-price-bg: #f2f2f2;
    --raffle-btn-bg: #e4bc1c;
}

.ticket-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: column;
}

.qty-slider,
.qty-slider-wrapper {
    width: 100%;
}

.qty-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.qty-button-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.raffle-msg {
    font-size: smaller;
    color: black;
}

img.raffle-plus-icon,
img.raffle-minus-icon {
    max-width: 60% !important;
}

.qty-btn {
    background-color: #e4bc1c;
    border: 1px solid #e4bc1c;
    padding: 0; /* Remove extra padding for a perfect circle */
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 50%;
    height: 30px;
    width: 30px;
    display: flex;
    justify-content: center;
    align-items: center; /* Center the content vertically */
    font-weight: 900;
}

.qty-btn:hover {
    opacity: 0.8;
}

.qty-display {
  min-width: 35px;
  text-align: center;
  font-weight: bold;
}

.qty-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #ddd; /* Default track color */
    border-radius: 4px;
    outline: none;
    transition: background 0.3s ease;
}

.qty-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #e4bc1c 0%, #e4bc1c 0%, #ddd 0%, #ddd 100%);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.qty-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #ffffff; /* Light thumb */
    border: 2px solid #e4bc1c; /* Accent border */
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); /* Soft shadow */
    cursor: pointer;
    margin-top: -6px; /* Align with track */
}

.qty-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ffffff;
    border: 2px solid #e4bc1c;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.welcome-modal {
    background-color: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    overflow-y: auto;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.welcome-modal h2 {
    font-size: 1.8rem;
    margin-top: 1rem;
    font-weight: bold;
    color: #1c1c1c;
}

.welcome-section {
    border-bottom: 1px solid #ddd;
}

#welcome-link-section,
#welcome-good-luck {
    padding-bottom: 1rem;
}

.welcome-section:last-of-type {
    border-bottom: none;
}

.welcome-text {
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.5;
}

.welcome-subheading {
    font-size: 1.2rem;
    font-weight: bold;
}

.welcome-list {
    list-style-position: inside;
    margin: 0 auto;
    padding: 0;
    padding-top: 0.75rem;
    text-align: left;
}

.welcome-list-item {
    padding-bottom: 0.75rem;
}

.welcome-list-item:last-child {
    border-bottom: none;
}

.welcome-link {
    color: #e4bc1c;
    text-decoration: underline;
}

.welcome-ok-btn {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 1.4rem;
    background-color: #e4bc1c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    width: 200px;
}

#welcome-intro {
    padding-bottom: 1rem;
}

.welcome-ok-btn:hover {
  opacity: 0.8;
}

.raffles-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    padding-bottom: 50px;
    align-items: center;
}

.jackpot-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 40px;
    padding-right: 20px;
    padding-left: 20px;
    padding-bottom: 40px;
    max-width: 1130px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

.jackpot-header {
    max-width: 1400px;
    padding: 0 40px;
    text-align: center; /* or 'left' for desktop consistency */
}


.jackpot-title {
    font-size: 3.5em;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 3px solid var(--btn-add-to-cart-bg);
    padding-bottom: 10px;
    color: var(--text-main);
    -khtml-user-select: none;
    -o-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

.jackpot-amount {
    font-size: 3.5em;
    font-weight: bold;
    margin-top: 0;
    color: var(--text-main);
    -khtml-user-select: none;
    -o-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.raffles-section {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 20px;
    padding: 0px 10px;
    max-width: 1400px;
    margin: 0 auto;
}

#row1, #row2, #row3, #row4 {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 0 auto;
    width: 100%;
}

@keyframes slideDownUp {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        transform: translateY(0);
        opacity: 1;
    }
    90% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Wrapper absolutely positioned just above the footer */
.input-error-wrapper {
    position: absolute;
    top: 0%;        /* stick it just above the footer */
    left: 50%;           /* center horizontally */
    transform: translateX(-50%);
    width: 100%;          /* stretch to 90% of card width */
    max-width: 320px;    /* max width to keep it manageable */
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
    margin-bottom: 12px; /* gap from footer */
}

/* Error message centered inside wrapper */
.inline-error-message {
    position: absolute;
    top: 10px;
    transform: translateX(-50%);
    background: #ffffff;
    /* border: 1px solid rgb(255, 167, 38); */
    color: rgb(230, 81, 0);
    /* border: 1px solid #e1e1e1; Match card border */
    /* box-shadow: 0 6px 12px var(--card-shadow); Same as card */
    font-weight: 500;
    padding: 12px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    z-index: 2;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    text-align: center;
    max-width: 100%;
    line-height: 1.3;
}

/* Show error: fade in and slide down */
.inline-error-message.show {
    opacity: 1;
    transform: translateY(0);
    font-weight: 700;
    pointer-events: auto;
}

/* Hide error: fade out and slide up */
.inline-error-message.hidden {
    opacity: 0;
    transform: translateY(-10px);
    font-weight: 700;
    pointer-events: none;
}

.raffle-card {
    width: 80%;
    padding: 0.5rem;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    background: var(--bg-white);
    text-align: center;
    box-shadow: 0 2px 10px var(--card-shadow);
    transition: transform 0.2s ease;
    -khtml-user-select: none;
    -o-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}


.raffle-card.active,
.raffle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px var(--card-shadow-hover);
}

.raffle-card:hover .raffle-id-badge {
    opacity: 1;
}

.raffle-card img {
    max-width: 40%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.image-wrapper {
    position: relative;
    height: auto;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 10px;
}

.raffle-id-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.75rem;
    padding: 4px 6px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
}

.tickets-sold {
    color: rgba(0, 0, 0, 0.4);
}

.image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    -khtml-user-select: none;
    -o-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

.raffle-details {
    margin-top: 0rem;
}

.raffle-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--btn-add-to-cart-bg);
    border-radius: 8px;
    text-align: center;
    display: block;
}

.price-sub {
    font-size: 0.75rem;
    font-weight: 400;
    color: #1a1a1a;
}

.raffle-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    align-items: center;
    width: 100%;
}

.raffle-actions button:hover {
    background-color: var(--btn-add-to-cart-bg-hover);
}

.raffle-footer {
    border-top: 1px solid var(--btn-add-to-cart-bg);
    margin-top: auto;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px;
}

.raffle-subtitle {
    color: black;
}

.raffle-footer-default {
    display: block;
    padding: 25px;
}

.raffle-footer-hover {
    display: none;
}

.raffle-card:hover .raffle-footer-default,
.raffle-card.active .raffle-footer-default {
    display: none;
    opacity: 1;
    pointer-events: auto;
}

.raffle-card:hover .raffle-footer-hover,
.raffle-card.active .raffle-footer-hover {
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    opacity: 1;
    pointer-events: auto;
}

.add-to-cart-btn {
    width: 100%; /* Explicit 25% width */
    font-size: 1.25rem;
    padding: 10px;
    background-color: var(--btn-add-to-cart-bg);
    color: var(--bg-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn:hover {
    background-color: var(--btn-add-to-cart-bg-hover);
}

.cart-icon {
  height: 30px; /* or whatever size you prefer */
  width: 30px;  /* Adjust the size */
}

.ticket-qty {
    width: 100%; /* Explicit 75% width */
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ticket-qty:focus {
    border-color: var(--btn-add-to-cart-bg);
    outline: none;
    background-color: var(--bg-white);
}

.raffle-progress {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.raffle-progress span {
    font-style: italic;
}

/*
.progress-bar-wrapper {
    width: 100%;
    background-color: var(--progress-bar-bg);
    height: 16px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar {
    height: 100%;
    transition: width 0.4s ease;
}
*/

.progress-bar-wrapper {
    position: relative; /* Make wrapper the positioning context */
    height: 20px; /* example height */
    background: #eee;
    border-radius: 5px;
    overflow: visible; /* so bubble can overflow */
}

.progress-bar {
    height: 100%;
    border-radius: 5px 0 0 5px;
}

.progress-bubble {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -175%);
    color: black;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 16px;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.remaining-tickets.sold-out,
.sold-out-label {
    color: var(--sold-out-color);
    font-weight: bold;
}

.sold-out-card {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(100%);
}

button.sold-out-btn {
    background-color: var(--sold-out-btn-bg) !important;
    color: #666;
    cursor: not-allowed !important;
}

@media (min-width: 0px) and (max-width: 768px) {
    .raffle-card {
        width: 85%;
        min-width: unset;
    }

    .raffle-card img {
        max-width: 70%;
    }

    #row1, #row2, #row3, #row4 {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .raffle-actions button {
        font-size: 1.2rem;
        height: auto;
    }

    .raffle-header {
        font-size: 2rem;
        padding-bottom: 20px;
    }

    .raffle-details {
        font-size: 1rem;
    }

    .qty-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        width: 100%;
        flex-direction: column;
    }

    .qty-button-wrapper {
        gap: 20px;
    }

    .qty-top-row {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
    }

    .qty-slider-wrapper {
        order: 2; /* slider stays below buttons */
    }

    .add-to-cart-btn {
        order: 3; /* move add-to-cart below slider */
        width: 100%; /* full width for mobile */
    }

    /* TESTING */

    /*
    .raffle-footer {
        border-top: 1px solid var(--btn-add-to-cart-bg);
        margin-top: auto;
        text-align: center;
        transition: all 0.3s ease;
        position: relative;
        padding: 5px;
    }

    .ticket-qty-wrapper {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-direction: column;
    }
    */

    .raffle-card:hover .raffle-footer-hover, .raffle-card.active .raffle-footer-hover {
        margin-top: 10px;
    }

    .qty-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .qty-btn {
        width: 30px;
    }

}

@media (min-width: 769px) and (max-width: 1024px) {
    #row1, #row2, #row3, #row4 {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .raffle-card {
        max-width: 90%;
        min-width: unset;
    }

    .raffle-card img {
        max-width: 50%;
    }

    .raffle-actions button {
        font-size: 1.2rem;
        height: 50px;
    }

    .raffle-header, .raffle-details {
        font-size: 2rem;
    }

    .raffle-footer-hover {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 10px;
    }

    .add-to-cart-btn {
        width: 100%;
    }

    .ticket-qty {
        padding: 16px 12px;
    }

    .progress-bar-wrapper {
        height: 32px;
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .raffle-progress span {
        font-size: 1rem;
    }
}

@media (min-width: 1025px) {
    .raffle-card {
        width: 260px;
    }

    #row1, #row2, #row3, #row4 {
        gap: 30px;
        margin: 10px;
    }

    .raffle-card img {
        max-width: 90%;
    }

    .raffle-actions button {
        font-size: 1rem;
        height: 40px;
        padding: 10px;
    }

    .raffle-header {
        font-size: 2rem;
    }

    .raffle-details {
        font-size: 1rem;
    }

    .raffles-section {
        padding-left: 20px;
        padding-right: 20px;
    }
}