﻿/* In wwwroot/css/shared-components.css */

.checkbox-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Adjusted for smaller items like days */
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
}

.checkbox-grid-item .form-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-grid-item .form-check-label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 50px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

    .checkbox-grid-item .form-check-label:hover {
        border-color: #ff5f95;
        box-shadow: 0 2px 4px rgba(0,0,0,0.07);
    }

.checkbox-grid-item .form-check-input:checked + .form-check-label {
    background-color: #ffe9f1;
    border-color: #ff5f95;
    color: #e91e63;
    font-weight: 600;
}



.roles-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    /* padding: 1.5rem; */
}

/* We hide the actual checkbox but keep it accessible */
.role-item .form-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Style the label to be the entire clickable area */
.role-item .form-check-label {
    display: flex; /* Change from 'block' to 'flex' */
    align-items: center; /* This centers the text vertically */
    justify-content: center; /* This centers the text horizontally */
    text-align: center; /* Ensures text itself is centered if it wraps */
    min-height: 60px; /* Give it a minimum height for better vertical alignment */
    width: 100%;
    padding: 0.95rem 1.25rem;
    cursor: pointer;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    user-select: none; /* Prevent text selection on click */
}

    /* Hover effect */
    .role-item .form-check-label:hover {
        border-color: #ff5f95; /* A soft blue hover */
        box-shadow: 0 2px 4px rgba(0,0,0,0.07);
    }

/* --- THE MAGIC: Style the LABEL when its associated checkbox IS CHECKED --- */
/* This uses the "adjacent sibling combinator" (+) which is supported by all browsers */
.role-item .form-check-input:checked + .form-check-label {
    background-color: #ffe9f1;
    border-color: #ff5f95;
    color: #e91e63;
    font-weight: 600;
}

.roles-grid-container-solo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    /* padding: 1.5rem; */
}

/* We hide the actual checkbox but keep it accessible */
.role-item-solo .form-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Style the label to be the entire clickable area */
.role-item-solo .form-check-label {
    display: flex; /* Change from 'block' to 'flex' */
    align-items: center; /* This centers the text vertically */
    justify-content: center; /* This centers the text horizontally */
    text-align: center; /* Ensures text itself is centered if it wraps */
    min-height: 52px; /* Give it a minimum height for better vertical alignment */
    width: 100%;
    padding: 0.7rem 1.25rem;
    cursor: pointer;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    user-select: none; /* Prevent text selection on click */
}

    /* Hover effect */
    .role-item-solo .form-check-label:hover {
        border-color: #ff5f95; /* A soft blue hover */
        box-shadow: 0 2px 4px rgba(0,0,0,0.07);
    }

/* --- THE MAGIC: Style the LABEL when its associated checkbox IS CHECKED --- */
/* This uses the "adjacent sibling combinator" (+) which is supported by all browsers */
.role-item-solo .form-check-input:checked + .form-check-label {
    background-color: #ffe9f1;
    border-color: #ff5f95;
    color: #e91e63;
    font-weight: 600;
}