/* =========================================================
   Character Control Panel (UCP Tools) Stylesheet
   ========================================================= */

.char-tool-card {
    background-color: rgba(16, 8, 30, 0.92);
    border: 1px solid rgba(0, 255, 102, 0.25);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: visible !important; /* Critical: allow dropdowns to overflow outside card */
    z-index: 10;
}

.char-tool-card:hover,
.char-tool-card:focus-within {
    transform: translateY(-2px);
    border-color: rgba(0, 255, 102, 0.6);
    box-shadow: 0 6px 20px rgba(0, 255, 102, 0.2);
    z-index: 50; /* Elevate entire card when user interacts with it */
}

.char-name {
    font-family: 'Cinzel', serif;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
}

.char-sub {
    font-size: 0.85rem;
    color: #cbd5e1;
}

/* XP Rate Form Stacking */
.xp-rate-form {
    position: relative;
    z-index: 60;
}

.xp-select-wrapper {
    position: relative;
    z-index: 70;
}

/* Native select styling */
.dark-select {
    background-color: #0c0616 !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(0, 255, 102, 0.4) !important;
    border-radius: 6px !important;
    padding: 8px 14px !important;
    font-size: 0.92rem !important;
    width: 100% !important;
}

.dark-select:focus {
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.5) !important;
    border-color: #00ff66 !important;
    outline: none !important;
}

/* jQuery SelectBox (sbHolder & sbOptions) Stacking Fix */
.sbHolder {
    width: 100% !important;
    background-color: #0c0616 !important;
    border: 1px solid rgba(0, 255, 102, 0.4) !important;
    border-radius: 6px !important;
    position: relative !important;
    z-index: 80 !important;
    min-height: 42px !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.sbHolder .sbSelector {
    color: #f1f5f9 !important;
    font-size: 0.92rem !important;
    padding: 10px 14px !important;
    background: transparent !important;
    font-weight: 500 !important;
}

.sbHolder .sbToggle {
    border-left: 1px solid rgba(0, 255, 102, 0.2) !important;
    width: 40px !important;
}

/* Ensure the dropdown list always renders on TOP of the Save button and cards */
.sbHolder .sbOptions {
    position: absolute !important;
    top: calc(100% + 3px) !important;
    left: 0 !important;
    width: 100% !important;
    max-height: 240px !important;
    background-color: #0c0616 !important;
    border: 1px solid #00ff66 !important;
    border-radius: 6px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.95), 0 0 15px rgba(0, 255, 102, 0.3) !important;
    z-index: 999999 !important; /* Forces dropdown over all buttons and content */
    overflow-y: auto !important;
}

.sbHolder .sbOptions li a {
    background-color: #0c0616 !important;
    color: #f1f5f9 !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.sbHolder .sbOptions li a:hover,
.sbHolder .sbOptions li a.sbFocus {
    background-color: rgba(0, 255, 102, 0.22) !important;
    color: #00ff66 !important;
    text-shadow: 0 0 8px rgba(0, 255, 102, 0.6) !important;
}

/* Save button & utility buttons must stay below the dropdown */
.char-tool-card .btn {
    position: relative;
    z-index: 1 !important;
}

.char-tool-card .btn:hover {
    z-index: 2 !important;
}

.text-fel {
    color: #00ff66 !important;
}

.font-size-sm {
    font-size: 0.88rem;
}
