/* CSS for the Rifa Layout */
:root {
    --primary-pink: #FFD1DC;
    --secondary-pink: #FFA6C9;
    --dark-pink: #FF69B4;
    --sold-color: #FA8072;
    --available-color: #6BCB77;
    --text-color: #555;
    --bg-overlay: rgba(255, 255, 255, 0.85);
    /* Makes the background soft */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Fredoka', cursive;
    background-image: url('assets/background.png');
    /* The generated background */
    background-size: cover;
    background-repeat: repeat;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-overlay);
    z-index: -1;
}

.container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.2);
    width: 90%;
    max-width: 800px;
    margin: 20px;
    position: relative;
    border: 3px solid var(--secondary-pink);
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-family: 'Pacifico', cursive;
    color: var(--dark-pink);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0px #fff;
}

.subtitle {
    margin-bottom: 5px;
    font-size: 1.2rem;
    color: #666;
    font-weight: 500;

.instruction-text {
    font-size: 0.95rem;
    color: var(--dark-pink);
    margin-bottom: 1.5rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.8);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 15px;
    border: 1px dashed var(--secondary-pink);
}
}

/* Grid Layout */
.raffle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    margin-bottom: 2rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.grid-item {
    background-color: var(--available-color);
    color: white;
    font-weight: bold;
    border-radius: 8px;
    /* Rounded square */
    width: 100%;
    aspect-ratio: 1;
    /* Keep it square */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
    user-select: none;
    border: 2px solid white;
}

.grid-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.grid-item.sold {
    background-color: var(--sold-color);
    cursor: not-allowed;
    opacity: 0.7;
    position: relative;
}

.grid-item.sold::after {
    content: 'X';
    position: absolute;
    font-size: 1.2rem;
    color: #fff;
    opacity: 0.5;
}

.grid-item.selected {
    background-color: var(--dark-pink);
    color: white;
    transform: scale(0.95);
    border-color: var(--secondary-pink);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Floating Selection Bar */
.selection-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
    align-items: center;
    gap: 20px;
    border: 2px solid var(--secondary-pink);
    z-index: 1000;
    animation: slideUp 0.3s forwards;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 50px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.selection-info {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

#selectionCount {
    font-weight: bold;
    color: var(--dark-pink);
}

#selectionTotal {
    font-size: 0.8rem;
    color: #888;
}

.btn-checkout {
    background-color: var(--available-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.btn-checkout:hover {
    transform: scale(1.05);
}

/* Footer & Bear */
.info-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-top: 2px dashed var(--secondary-pink);
    padding-top: 1rem;
}

.bear-emoji {
    font-size: 4rem;
    animation: bearBounce 2s infinite ease-in-out;
}

@keyframes bearBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.price {
    font-size: 1.5rem;
    color: var(--dark-pink);
    font-weight: bold;
    margin: 10px 0;
}

.pix {
    font-size: 1.1rem;
    background-color: #eee;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    color: #333;
}

.beneficiary {
    font-size: 0.9rem;
    color: #888;
    margin-top: 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    border: 4px solid var(--secondary-pink);
    position: relative;
    animation: slideIn 0.3s forwards;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close:hover,
.close:focus {
    color: red;
    text-decoration: none;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
}

input:focus {
    border-color: var(--secondary-pink);
    outline: none;
}

.btn-confirm {
    width: 100%;
    padding: 12px;
    background-color: var(--dark-pink);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn-confirm:hover {
    background-color: #e04ca0;
}

/* Decorations */
.butterfly-decoration {
    position: absolute;
    color: var(--secondary-pink);
    opacity: 0.6;
    font-size: 2rem;
}

.b1 {
    top: 20px;
    left: 20px;
    transform: rotate(-20deg);
}

.b2 {
    top: 20px;
    right: 20px;
    transform: rotate(20deg);
}

/* Scrollbar for grid */
.raffle-grid::-webkit-scrollbar {
    width: 8px;
}

.raffle-grid::-webkit-scrollbar-thumb {
    background-color: var(--secondary-pink);
    border-radius: 4px;
}