/* EquipmentBuild.css - FINAL PRECISION VERSION */

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #1a1a1a; 
    color: #e0e0e0; 
    margin: 0; 
    padding: 20px; 
}

#classInput {
cursor: pointer;    
    user-select: none;
    -webkit-user-select: none;
    caret-color: transparent;
    outline: none;
}
#toggleAttributes {
    accent-color: #005a9e; /* Matches your theme color */
    width: 12px;
    height: 12px;
    cursor: pointer;
}

#toggleAttributes:hover {
    filter: brightness(1.2);
}
#total-stats-summary {
overflow-y: visible; 
    overflow-x: visible; 
    max-height: none;   
    padding: 10px;
}
#wrapper-weapon { z-index: 89; position: relative; }
#wrapper-shield { z-index: 88; position: relative; }
#wrapper-helmet { z-index: 87; position: relative; }
#wrapper-armor  { z-index: 86; position: relative; }
#wrapper-gloves { z-index: 85; position: relative; }
#wrapper-boots  { z-index: 84; position: relative; } 
#wrapper-ring  { z-index: 83; position: relative; }
#wrapper-earring { z-index: 82; position: relative; }
#wrapper-bracelet { z-index: 81; position: relative; }
#wrapper-necklace { z-index: 80; position: relative; }
#wrapper-mount { z-index: 79; position: relative; }
#wrapper-stone { z-index: 78; position: relative; }
#wrapper-pran-hat { z-index: 77; position: relative; }
#wrapper-pran-accessory { z-index: 76; position: relative; }
#wrapper-pran-dress { z-index: 75; position: relative; }
#wrapper-pran-wings { z-index: 74; position: relative; }
#wrapper-pran-wand { z-index: 73; position: relative; }

.builder-container { 
    margin: 0 auto; 
    background: #252525; 
    padding: 25px 5px 25px 5px; 
    border-radius: 12px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.6); 
    
}

h1 { 
    font-size: 22px; 
    margin-bottom: 20px; 
    color: #fff; 
    border-left: 4px solid #005a9e; 
    padding-left: 15px; 
}

.section-header { 
font-size: 14px; 
    font-weight: bold; 
    color: #005a9e; 
    text-transform: uppercase; 
    margin: 25px 0 10px 0; 
    border-bottom: 1px solid #333; 
    padding-bottom: 5px;
    padding-left: 15px; /* <--- This is the culprit */
}
.sidebar-header {
    margin: 0 0 10px 0 !important; /* Remove top margin so it sits flush */
    padding-left: 0 !important;    /* Remove the 15px shift causing it to go "too far left" */
    border-bottom: 1px solid #005a9e; /* Thicker accent for the sidebar */
    font-size: 12px;
 
}

.row-container { 
    display: grid; 
    grid-template-columns: 1fr 220px; 
    gap: 20px; 
    margin-bottom: 20px; 
    padding: 15px; 
    background: #2d2d2d; 
    border-radius: 8px; 
    position: relative;
    z-index: 1;
    overflow: visible !important;
}
.row-container:focus-within {
    z-index: 2 !important;
}


.accessory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.equipment-column { display: flex; flex-direction: column; gap: 8px; }
.crystal-column .combo-input {
    padding: 0 25px 0 5px !important; /* Reclaims 40px of space */
}
 

.crystal-column .dropdown-item .dropdown-desc {
    display: none !important;
}
.crystal-column .dropdown-item .dropdown-title {
    white-space: normal;
    line-height: 1.2;
    font-size: 12px;
}
/* Visual separation for Enchantments */
.crystal-column { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    background: rgba(0,0,0,0.2);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #383838;
}

/* --- PRECISION ICON SYSTEM --- */
.sprite-icon { 
width: 42px; 
    height: 42px; 
    background-color: #000; 
    border: 1px solid #444; 
    image-rendering: pixelated;
    background-repeat: no-repeat;
    display: block;
}
.crystal-socket-container .sprite-icon,
.crystal-column .dropdown-item .sprite-icon {
    width: 32px !important;
    height: 32px !important;

}
.crystal-column .dropdown-item .sprite-icon,
.crystal-socket-container .sprite-icon {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0;
}
.equipment-column .sprite-icon,
.equipment-column .dropdown-item .sprite-icon {
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0;
    background-repeat: no-repeat;
}
 .equipment-column .combo-input {
    padding-right: 42px !important; /* Prevents text overlap with the closer button */
}

.crystal-socket-container {
display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

/* --- Input Groups --- */
.input-group { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    position: relative;
 
}

.input-anchor {
    position: static; 
    flex-grow: 1;
    display: flex;
    align-items: center;
}
.clear-btn {
    position: absolute;
    right: 24px; /* Positioned before the dropdown arrow */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    z-index: 15;
    display: none; /* Hidden by default */
    padding: 0 4px;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: #fff;
}

/* Show button only when input has text */
.combo-input:not(:placeholder-shown) ~ .clear-btn {
    display: block;
}

/* Crystal specific clear button adjustment */
.crystal-socket-container .clear-btn {
    right: 22px;
    font-size: 13px;
    padding: 0 2px;
}

.crystal-socket-container:focus-within {
    z-index: 90;
}
.combo-input { 
    width: 100% !important; 
    height: 38px !important;
    background: #121212 !important; 
    color: #fff !important; 
    border: 1px solid #444 !important; 
    border-radius: 6px !important; 
    box-sizing: border-box !important;
    font-size: 13px !important;
    outline: none !important;
    padding: 0 45px 0 12px !important;
}

/* Fix: Right padding for crystal inputs to prevent overlap */
.crystal-socket-container .combo-input { 
    width: 100%; /* Force it to stay within the narrower column */
    font-size: 11px; /* Slightly smaller font to prevent text clipping in narrow boxes */
    padding: 0 38px 0 8px !important; /* Increased left; enough right padding for small clear btn */
}

/* --- Dropdown UI --- */
.dropdown-arrow-container { 
    position: absolute !important; 
    right: 0px !important; 
    height: 100%; 
    width: 24px; 
    display: flex !important;  
    align-items: center !important; 
    justify-content: center !important; 
    cursor: pointer !important; 
    z-index: 10 !important;
}

.dropdown-arrow { 
    width: 0; height: 0; 
    border-left: 4px solid transparent; 
    border-right: 4px solid transparent; 
    border-top: 5px solid #777; 
}
.dropdown-item span {
    font-size: 13px;
    line-height: 1.4;
    padding-top: 2px; /* Slight nudge for optical alignment with top of icon */
    word-break: break-word;
}
 
.dropdown-content { 
    position: absolute;
    top: 100%; /* Below the row */
    left: 0;   /* Left-aligned with the leading icon */
    right: 0;  /* Spans to the right edge of the input box */
    width: auto; /* Allow right: 0 to dictate the width */
    max-height: 300px;
    overflow-y: auto;
    background: #333;
    border: 1px solid #555;
    z-index: 90 !important;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    margin-top: 5px; /* Small gap between row and dropdown */
}
.dropdown-content.active {
    display: block;
}
.dropdown-results {
    position: absolute;
    z-index: 90;
    left: 0; /* We will override this in JS */
    box-sizing: border-box;
    /* Remove any hardcoded width here */
}
.dropdown-item { 
    display: flex !important; 
    align-items: center; /* Top-aligned text */
    padding: 10px; 
    cursor: pointer; 
    color: #fff;
    border-bottom: 1px solid #444;
    transition: background 0.2s;

}
.dropdown-item:hover { background: #3a3a3a; }

/* Dropdown icons need a fixed scale to match 24px display */
.dropdown-item-icon {
    flex-shrink: 0;
    border: 1px solid #444;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

/* --- Stats & Labels --- */
.stat-block { 
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5); 
    padding: 4px 10px; 
    border-radius: 4px; 
    border: 1px solid #444; 
    margin-top: 6px;
    margin-right: 6px;
}
.stat-label { color: #888; font-size: 10px; font-weight: bold; text-transform: uppercase; margin-right: 8px; }
.stat-value { 
    color: #ffd700;
    font-weight: bold;
    text-align: left;
    margin-left: auto;  
    padding-right: 5px;
    font-size: 12px;
 }
.side-panel {
    width: 250px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    /* Change hidden to visible so tooltips can show outside the panel */
    overflow-x: visible !important; 
    background: #252525;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 90;
    scrollbar-gutter: stable;
}
 
.panel-section {
    overflow: visible !important;
    position: relative;
    z-index: 5; /* Base level for the side panel */
    margin-bottom: 25px;
}


.stat-row {
    font-size: 12px; /* Reduced from default (usually 13px or 14px) */
    padding: 4px 0;   /* Slightly tighter vertical spacing */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: help;
    color: #ccc;
    position: relative;
}
.stat-row strong, 
.stat-row {
    color: #fff;
    font-size: 12x;
}
.stat-row:hover .stat-tooltip {
    visibility: visible;
}
/* Tooltip Popup */
.stat-tooltip {
    visibility: hidden;
    position: fixed;
    left: 100%;        /* Start exactly where the sidebar ends */
    top: 0;            /* Align with the row top */
    margin-left: 15px; /* Gap from the sidebar edge */
    
    width: 260px;
    background: #2d2d2d;
    border: 1px solid #005a9e;
    z-index: 90;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    pointer-events: none;
}
.stat-row:hover .stat-tooltip {
    visibility: visible;
}
.tooltip-header {
font-weight: bold;
    color: #ffd700;
    border-bottom: 1px solid #444;
    margin-bottom: 6px;
    padding-bottom: 3px;
    text-transform: uppercase;
    /* Slightly smaller header to match */
    font-size: 10px;
}

.tooltip-entry {
display: flex;
    justify-content: space-between; /* Keeps source left, value right */
    gap: 15px;
    margin-bottom: 4px;
    font-weight: normal !important;
}

.tooltip-source { color: #aaa; }




.tooltip-entry {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
    /* Explicitly remove bold from entries */
    font-weight: normal !important; 
}

.tooltip-val { 
    color: #ffffff !important; 
    font-weight: normal !important; 
}
.set-effect-label, .set-effect-desc {
    transition: color 0.3s ease, font-weight 0.3s ease;
}
.set-box {
    background: rgba(0,0,0,0.4);
    padding: 13px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #005a9e;
    transition: border-color 0.3s ease;
}

.set-title { 
    font-weight: bold; 
    color: #fff; 
    font-size: 14px; 
    margin-bottom: 12px; 
    text-transform: uppercase;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}
.set-effect-group {
    margin-bottom: 10px;
}

.set-effect-label {
font-size: 11px;
    display: block;
    font-size: 0.85em;
    margin-bottom: 2px;
    color: #888; /* The label (e.g., Set Effect(3)) stays neutral */
}
/* Specific styling for the Skill text when active */
.set-effect-group.active .set-effect-desc.is-skill {
    color: #ffcc00; /* Bright gold/orange for active skills */
    font-weight: bold;
    margin-bottom: 12px;
}
.set-effect-desc {
    margin-left: 12px; 
    font-size: 12px; 
    margin-bottom: 2px;
}
.set-stat { font-size: 11px; margin-bottom: 2px; }
.set-stat.active { color: #00ffcc; font-weight: bold; }
.set-stat.inactive { color: #555; }
.set-effect-group {
    margin-bottom: 12px;
    padding-left: 5px;
    transition: color 0.2s ease;
}

/* Active coloring */
.set-effect-group.active .set-effect-label {
    color: #ffd700 !important; /* Gold for Active Header */
    font-weight: bold;
}
.set-effect-group.active .set-effect-desc {
    color: #fff;
}
.set-effect-group.active {
    color: #ffd700 !important; /* Gold for active stats */
}
.active .set-effect-desc:contains("Chance to cast") {
    color: #ffd700;
}
/* Inactive coloring */
.set-effect-group.inactive .set-effect-label,
.set-effect-group.inactive .set-effect-desc {
    color: #666 !important;
}

/* --- Reinforcement Dropdown Fixes --- */
.reinforce-wrapper { 
    width: 65px; 
    flex-shrink: 0; 
    position: relative; 
    z-index: 10;
}
/* Target only the reinforcement dropdown list items */
.reinforce-wrapper .dropdown-item {
    font-size: 11px !important; /* Smaller font */
    padding: 3px 8px !important; /* Tighter vertical spacing */
    justify-content: flex-start;     /* Keep text centered */
    border-bottom: 1px solid #333;
    text-align: left !important;
}
.reinforce-wrapper .dropdown-arrow-container {
    width: 20px !important;
}
/* --- Reinforcement Input Precision --- */
.reinforce-wrapper .reinforce-input {
    /* Reclaim the space since there is no clear button here */
    padding-right: 22px !important; 
    padding-left: 6px !important;
    text-align: left !important;
    font-weight: bold !important;
    color: #ffd700 !important;
    text-indent: 4px;
}
.reinforce-input { 
    color: #ffd700 !important; 
    font-weight: bold !important; 
    cursor: pointer !important; 
    background: #121212 !important;
    padding: 0 !important; /* Center text */
    font-size: 11px !important;
    text-align: left !important;
    padding-left: 8px !important;
}
.reinforce-wrapper:focus-within .dropdown-content {
    display: block;
    z-index: 90;
}
.reinforce-wrapper .dropdown-content {
    max-height: 180px;
    overflow-y: auto;
}
 

.set-stat.active {
    color: #00ffcc;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
}

.set-stat.inactive {
    font-size: 11px;
    font-style: italic;
}

label { display: block; font-size: 9px; font-weight: bold; color: #666; text-transform: uppercase; margin-bottom: 4px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }


 
.crystal-column .dropdown-item .dropdown-title {
    white-space: normal !important; /* Forces text to wrap to next line */
    word-wrap: break-word;
    line-height: 1.2;
    font-size: 12px;
    display: block; /* Ensures it takes up the full width next to the icon */
    padding-right: 5px;
}
.crystal-column .dropdown-item {
    height: auto !important;
    min-height: 40px;
    padding: 6px 4px;
    align-items: center; /* Keeps icon centered if text is short, or aligned to top if tall */
    display: flex;
}
/* 1. Hide the description line in enchantment dropdowns */
.crystal-column .dropdown-content .item-details-line {
    display: none !important;
}

/* 2. Allow the item name (the first span) to wrap */
.crystal-column .dropdown-content .search-result-item span:first-of-type {
    white-space: normal !important; /* Overrides the inline 'nowrap' */
    word-wrap: break-word;
    display: block;
    padding-right: 5px;
    font-size: 12px;
}

/* 3. Adjust the container to fit the wrapped text */
.crystal-column .dropdown-content .search-result-item {
    height: auto !important;
    min-height: 40px;
    padding: 8px 4px;
    display: flex;
    align-items: center;
}
/* Specialized fix for the narrow Crystal columns */
.crystal-column .dropdown-content {
    width: 100% !important;
    left: 0 !important;
}
/* 1. Hide ONLY the description line, not the whole text container */
.crystal-column .dropdown-content .item-details-line {
    display: none !important;
}

/* 2. Allow the name span to wrap. 
   We target the span inside the div that follows the icon */
.crystal-column .search-result-item div > span:first-child {
    white-space: normal !important;
    word-wrap: break-word;
    display: block !important;
    line-height: 1.2;
    padding-bottom: 2px;
}

/* 3. Ensure the result item can expand vertically for wrapped text */
.crystal-column .search-result-item .sprite-icon {
    width: 28px !important;
    height: 28px !important;
    background-size: contain !important; /* This is the key for proper scaling */
    image-rendering: auto; /* Change to auto if pixelated looks blurry at 28px */
}

/* --- Set Banner Animation --- */
.combo-container {
    position: relative; /* Ensure the banner stays within the box */
    overflow: visible;  /* Allow banner to slide "up" out of bounds if needed */
}

.set-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    right: 0;
    height: auto; /* Matches input height or slightly smaller */
    min-height: 26px;
    background: linear-gradient(to right, #2a2a2a, #1a1a1a); /* Dark gold gradient */
    border: 1px solid #ffd700;
    box-sizing: border-box;
    border-radius: 4px;
    z-index: 90; /* Behind the input, or 10+ to be in front */
    display: flex;
    flex-direction: column;
    align-items: center;    /* Horizontal centering */
    justify-content: center; /* Vertical centering */
    padding: 6px 4px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    transform: translateY(0);
    opacity: 0;
    pointer-events: none; /* Can't click it while hidden */
   
}

.set-banner.active {
    transform: translateY(calc(-100% - 4px));
    opacity: 1;
    pointer-events: auto;
}

.set-text {
    font-size: 10px;
    color: #ffd700;
    display: block;       /* Forces it to its own line */
    text-align: center;   /* Centers the text string */
    line-height: 1.3;
    width: 100%;
    margin: 0;
    padding: 0 2px;
    word-wrap: break-word;
    font-weight: bold;
    margin-bottom: 12px;
}

/* Styling for the links inside the banner */
.banner-link {
color: #000;
    text-decoration: none;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 10px;
    background: #ffd700;  /* Solid gold buttons for easier clicking */
    border-radius: 2px;
    transition: background 0.2s;
}
.banner-link-container {
    display: flex;
    justify-content: center;
    gap: 10px;             /* Space between buttons without a separator */
    width: 100%;
}

.banner-link:hover {
background: #fff;
}

 .set-bonus-group {
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
    border-left: 2px solid #ffd700;
}

.set-bonus-title {
    color: #ffd700;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 5px;
}

.set-bonus-line {
    font-size: 11px;
    margin-left: 5px;
    line-height: 1.4;
}

.active-bonus {
    color: #00ff00; /* Green for active */
}

.inactive-bonus {
    color: #777; /* Grey for inactive */
    text-decoration: line-through;
}



/* Custom Scrollbar for the Side Panel */
.side-panel::-webkit-scrollbar {
    width: 6px;
}
.side-panel::-webkit-scrollbar-track {
    background: #1a1a1a;
}
.side-panel::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}
.side-panel::-webkit-scrollbar-thumb:hover {
    background: #005a9e;
}
/* Container for stats below the equipment input boxes */
.item-stats-container {
    margin-top: 2px;
    padding: 2px 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

 