/* ==========================================================================
   CHECKBOX.CSS - Modern Custom Checkbox Component (SGOOI Emerald Green Theme)
   ========================================================================== */

/* Custom Checkbox Container Label */
.custom-checkbox-wrap,
.checkbox-pill-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #334155);
    transition: all 0.2s ease;
    position: relative;
}

/* Hide native checkbox */
.custom-checkbox-wrap input[type="checkbox"],
.checkbox-pill-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Custom Checkbox Box */
.custom-checkbox-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.custom-checkbox-box i {
    font-size: 10.5px;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hover State */
.custom-checkbox-wrap:hover .custom-checkbox-box,
.checkbox-pill-card:hover .custom-checkbox-box {
    border-color: #075e34;
    background: #f0fdf4;
}

/* Global Checked State (Works for ALL Wrappers) */
input[type="checkbox"]:checked + .custom-checkbox-box,
.custom-checkbox-wrap input[type="checkbox"]:checked + .custom-checkbox-box,
.checkbox-pill-card input[type="checkbox"]:checked + .custom-checkbox-box {
    background: linear-gradient(135deg, #075e34, #10b981) !important;
    border-color: #075e34 !important;
    box-shadow: 0 2px 8px rgba(7, 94, 52, 0.35) !important;
}

input[type="checkbox"]:checked + .custom-checkbox-box i,
.custom-checkbox-wrap input[type="checkbox"]:checked + .custom-checkbox-box i,
.checkbox-pill-card input[type="checkbox"]:checked + .custom-checkbox-box i {
    opacity: 1 !important;
    transform: scale(1) !important;
    color: #ffffff !important;
}

/* Focus Ring */
.custom-checkbox-wrap input[type="checkbox"]:focus + .custom-checkbox-box,
.checkbox-pill-card input[type="checkbox"]:focus + .custom-checkbox-box {
    box-shadow: 0 0 0 3px rgba(7, 94, 52, 0.2);
}

/* Checkbox Pill Card Style (Used in Export & Filter grids) */
.checkbox-pill-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 8px;
}

.checkbox-pill-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.checkbox-pill-card:has(input[type="checkbox"]:checked) {
    background: #f0fdf4;
    border-color: #86efac;
    color: #075e34;
    box-shadow: 0 2px 10px rgba(7, 94, 52, 0.1);
}

/* Checkbox Grid Utility */
.applicator-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

/* ==========================================================================
   DARK MODE OVERRIDES
   ========================================================================== */
body.dark-mode .custom-checkbox-box {
    background: #1e293b;
    border-color: #475569;
}

body.dark-mode .custom-checkbox-wrap:hover .custom-checkbox-box,
body.dark-mode .checkbox-pill-card:hover .custom-checkbox-box {
    border-color: #059669;
    background: #122b20;
}

body.dark-mode .custom-checkbox-wrap {
    color: #cbd5e1;
}

body.dark-mode .checkbox-pill-card {
    background: #111c2e;
    border-color: #1e2d42;
    color: #cbd5e1;
}

body.dark-mode .checkbox-pill-card:hover {
    background: #16263d;
    border-color: #2a3d58;
}

body.dark-mode .checkbox-pill-card:has(input[type="checkbox"]:checked) {
    background: #0d2119;
    border-color: #059669;
    color: #34d399;
}
