/* Styles for the Raffle Selection Modal */
#raffleSelectionModal.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1001; /* Above header and other modals */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Darker background */
    justify-content: center; /* Center content */
    align-items: center;
    padding: 20px; /* Add some padding */
}

#raffleSelectionModal .modal-content {
    background-color: #fefefe;
    margin: auto; /* Center vertically and horizontally */
    padding: 30px;
    border-radius: 10px;
    width: 90%; /* Responsive width */
    max-width: 700px; /* Max width */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Max height */
    overflow-y: auto; /* Enable scrolling within content if needed */
}

#raffleSelectionModal .close-button {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s ease;
}

#raffleSelectionModal .close-button:hover,
#raffleSelectionModal .close-button:focus {
    color: #777;
    text-decoration: none;
    cursor: pointer;
}

#raffleSelectionModal h3 {
    text-align: center;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
}

#raffleSelectionModal .modal-raffle-details {
    background-color: #eef;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #cce;
}

#raffleSelectionModal .modal-raffle-details p {
    margin-bottom: 8px;
    font-size: 1em;
    color: #555;
}

#raffleSelectionModal .modal-raffle-details strong {
    color: var(--primary-color);
}

#raffleSelectionModal .modal-selection-options {
    margin-bottom: 20px;
}

#raffleSelectionModal .modal-selection-options h4 {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: var(--secondary-color);
    text-align: center;
}

/* Styles for the radio buttons to select method */
#raffleSelectionModal .selection-method-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

#raffleSelectionModal .selection-method-options label {
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#raffleSelectionModal .selection-method-options label:hover {
    background-color: #eee;
    border-color: #bbb;
}

#raffleSelectionModal .selection-method-options input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

/* New styles for checkbox options. Assuming they are structured with a parent container and then a label. */
#raffleSelectionModal .checkbox-options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

#raffleSelectionModal .checkbox-option {
    display: flex;
    align-items: center; /* Alinea verticalmente el checkbox y el texto */
    gap: 10px; /* Añade un espacio entre el checkbox y el texto */
}

#raffleSelectionModal .checkbox-option input[type="checkbox"] {
    cursor: pointer;
    margin: 0; /* Asegura que no haya margen extra del input */
}

#raffleSelectionModal .checkbox-option label {
    cursor: pointer;
    font-weight: 400; /* Puedes ajustar esto */
    color: var(--text-color);
}
/* End of new checkbox styles */

#raffleSelectionModal .selection-method-options input[type="radio"]:checked + span {
     font-weight: 600; /* Not using span in HTML, but good practice */
}

/* Styles for the content div based on selected method */
#raffleSelectionModal .method-content {
    padding-top: 20px;
    border-top: 1px solid #eee;
    /* display controlled by JS */
}

#raffleSelectionModal .method-content h4 {
     font-size: 1.2em;
     margin-bottom: 15px;
     color: var(--text-color);
     text-align: left;
}

#raffleSelectionModal .method-content .form-group {
    margin-bottom: 15px;
}

#raffleSelectionModal .method-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

#raffleSelectionModal .method-content input[type="text"],
#raffleSelectionModal .method-content input[type="tel"],
#raffleSelectionModal .method-content input[type="number"] {
     width: 100%;
     padding: 10px;
     border: 1px solid #ddd;
     border-radius: 5px;
     font-size: 1em;
     font-family: 'Poppins', sans-serif;
}

#raffleSelectionModal .method-content small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

#raffleSelectionModal #check-number-availability {
    margin-top: 10px;
    margin-bottom: 15px;
    display: inline-block; /* or block if desired */
    padding: 10px 15px;
}

#raffleSelectionModal #manual-client-info {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 20px;
}

#raffleSelectionModal #manual-client-info h4 {
    margin-bottom: 10px;
}

#raffleSelectionModal #submit-selection-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    margin-top: 25px; /* Add margin above the final button */
    /* New styles for the attractive button */
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
    font-weight: 700; /* Make text bolder */
    letter-spacing: 0.5px; /* Slight letter spacing */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); /* Add a subtle shadow */
}

#raffleSelectionModal #submit-selection-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

#raffleSelectionModal #submit-selection-btn:disabled {
    background: #ccc; /* Grey out when disabled */
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}

#raffleSelectionModal #raffle-modal-message {
     margin-top: 20px;
     padding: 10px;
     border-radius: 5px;
     text-align: center;
     font-weight: 600;
}

/* Specific messages within method content */
#raffleSelectionModal .method-content .form-message {
    margin-top: 15px; /* Adjust margin */
}

/* Add margin-bottom to prevent content from touching the bottom */
#raffleSelectionModal .modal-content > *:last-child:not(.form-message) {
    margin-bottom: 20px;
}

/* Styles for the number selection grid within the raffle modal */
#raffleSelectionModal .numbers-dashboard {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#raffleSelectionModal .numbers-dashboard h5 {
    font-size: 1.3em;
    color: var(--secondary-color);
    margin-bottom: 15px;
    text-align: center;
}

#raffleSelectionModal .numbers-dashboard .numbers-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
    border: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 5px;
}

#raffleSelectionModal .numbers-dashboard .summary-item {
    text-align: center;
    font-size: 0.95em;
    color: #555;
    flex: 1; /* Allow items to share space */
    min-width: 90px; /* Minimum width to prevent too much squishing */
}

#raffleSelectionModal .numbers-dashboard .summary-count {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 5px;
}

#raffleSelectionModal .numbers-dashboard .status-available { color: #4CAF50; } /* Green */
#raffleSelectionModal .numbers-dashboard .status-sold { color: #F44336; } /* Red */
#raffleSelectionModal .numbers-dashboard .status-separated { color: #FFC107; } /* Yellow */

#raffleSelectionModal .numbers-grid-container {
    max-height: 250px; /* Max height with scroll for numbers grid */
    overflow-y: auto; /* Enable vertical scrolling */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #fff;
}

#raffleSelectionModal .numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); /* Smaller grid items for modal */
    gap: 6px; /* Smaller gap */
}

#raffleSelectionModal .number-item {
    padding: 6px 3px; /* Smaller padding */
    text-align: center;
    border-radius: 4px;
    font-size: 0.85em; /* Smaller font size */
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.3s ease, background-color 0.2s ease, border-color 0.2s ease;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#raffleSelectionModal .number-item:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Number Status Colors */
#raffleSelectionModal .number-item.status-available {
    background-color: #e8f5e9; /* Light Green */
    color: #2e7d32; /* Dark Green */
    border: 1px solid #a5d6a7;
}

#raffleSelectionModal .number-item.status-sold {
    background-color: #ffebee; /* Light Red */
    color: #c62828; /* Dark Red */
    border: 1px solid #ef9a9a;
}

#raffleSelectionModal .number-item.status-separated {
    background-color: #fffde7; /* Light Yellow */
    color: #fbc02d; /* Dark Yellow */
    border: 1px solid #fff59d;
}

/* Selected state for manual selection */
#raffleSelectionModal .number-item.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 5px rgba(106, 17, 203, 0.5);
    transform: scale(1.05); /* Slightly enlarge when selected */
}

/* Make sold/separated numbers not clickable for selection */
#raffleSelectionModal .number-item.status-sold,
#raffleSelectionModal .number-item.status-separated {
    cursor: default; /* Change cursor for non-selectable numbers */
}

#raffleSelectionModal .number-item.status-sold.selected,
#raffleSelectionModal .number-item.status-separated.selected {
    /* If they somehow get selected (which they shouldn't for input), remove selection style */
    border: 1px solid #ef9a9a; /* Back to normal border */
    box-shadow: none;
    transform: none;
}

@media (max-width: 600px) {
     #raffleSelectionModal .modal-content {
         width: 95%;
         padding: 20px;
     }

     #raffleSelectionModal h3 {
         font-size: 1.5em;
     }

    #raffleSelectionModal .selection-method-options label {
        font-size: 1em;
        padding: 6px 10px;
    }

     #raffleSelectionModal .method-content h4 {
         font-size: 1.1em;
     }
}
