/* ===============================================
   ELDER SPORES ONLINE - GEAR EDITOR STYLES
   Version: 1.0
   Created: January 10, 2025
   Following module-template.css patterns
   Sub-modal for trait/enchant/quality selection
   =============================================== */

/* ===============================================
   MODAL STRUCTURE (from template)
   =============================================== */

.gear-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;  /* Higher than gear-selector at 1000 */
    display: none;
}

.gear-editor-modal[style*="block"] {
    display: block !important;
}

.gear-editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.0);
}

.gear-editor-window {
    position: absolute;
    left: 20%; /* 29.66 */
    bottom: 2%;
    width: 60%; /* 39.2% */
    height: 81%;
    max-height: 800px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: var(--border-standard);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 0px 5px rgba(0, 0, 0, 0.9),
        0 0px 10px rgba(0, 0, 0, 0.9),
        0 0px 15px rgba(0, 0, 0, 0.9);
}

/* ===============================================
   MODAL HEADER (from template)
   =============================================== */

.gear-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to right, var(--color-secondary), #2a2a2a);
    border-bottom: 1px solid var(--color-secondary);
    border-radius: 22px 22px 0 0;
}

.gear-editor-header h3 {
    margin: 0;
    color: var(--color-primary);
    font-size: 1.3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.gear-editor-close {
    padding: 5px 10px;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 24px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.gear-editor-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===============================================
   MODAL CONTENT
   =============================================== */

.gear-editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(26, 26, 26, 0.95);
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.15)),
        url('/graphics/background-gear2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    scrollbar-width: thin;
    scrollbar-color: var(--color-secondary) #1a1a1a;
}

/* Two-column layout */
.editor-layout {
    display: flex;
    gap: 20px;
    min-height: 100%;
}

.editor-left-panel {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
}

.editor-right-panel {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    padding-top: 40px;
    padding-right: 10px;
}

/* Item tooltip preview placeholder */
.item-tooltip-preview {
    background: transparent;
    padding: 10px;
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* ESO Tooltip Container */
.eso-tooltip {
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    font-family: inherit;
}

/* Quality-specific tooltip borders */
.eso-tooltip.white {
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
.eso-tooltip.green {
    border: 2px solid #1eff00;
    box-shadow: 0 0 10px rgba(30, 255, 0, 0.3);
}
.eso-tooltip.blue {
    border: 2px solid #0070ff;
    box-shadow: 0 0 10px rgba(0, 112, 255, 0.3);
}
.eso-tooltip.purple {
    border: 2px solid #a335ee;
    box-shadow: 0 0 10px rgba(163, 53, 238, 0.3);
}
.eso-tooltip.gold {
    border: 2px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.eso-tooltip.mythic {
    border: 2px solid #ff8800;
    box-shadow: 0 0 15px rgba(255, 136, 0, 0.5);
}

/* Quality-specific tooltip title colors */
.tooltip-title.white { color: #ffffff; }
.tooltip-title.green { color: #1eff00; }
.tooltip-title.blue { color: #0070ff; }
.tooltip-title.purple { color: #a335ee; }
.tooltip-title.gold { color: #ffd700; }
.tooltip-title.mythic { color: #ff8800; }

/* Set bonus active/inactive states */
.bonus-line.bonus-active {
    color: #88ff88;
}

.bonus-line.bonus-inactive {
    color: #888;
}



/* Tooltip Header */
.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.tooltip-title {
    color: #ffd700;
    font-size: 1.3em;
    font-weight: bold;
    padding-top: 3px;
    padding-bottom: 9px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.tooltip-source {
    color: #999;
    font-size: 0.9em;
    text-align: right;
}

.tooltip-location {
    color: #999;
    font-size: 0.9em;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Slot and Armor Info */
.tooltip-slot-info {
    display: flex;
    justify-content: space-between;
    color: #bca784;
    font-size: 1.0em;
    margin-bottom: 12px;
    padding-left: 10px;
}

#tooltip-armor-value {
    color: #fff;
    font-weight: bold;
}

/* Dividers */
.tooltip-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #666, transparent);
    margin: 12px 0;
}

/* Section Titles */
.tooltip-section-title {
    color: #ffd700;
    font-size: 0.85em;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* Section Values */
.tooltip-section-value {
    color: #ddd;
    font-size: 0.9em;
    line-height: 1.4;
    padding-left: 10px;
}

/* Enchant and Trait sections */
.tooltip-enchant,
.tooltip-trait {
    margin-bottom: 8px;
}

/* Set Bonuses */
.tooltip-bonuses {
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.25;
}

.bonus-line {
    margin: 4px 0;
}

/* Configuration Sections */
.config-section {
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 55px;
}

.config-section label {
    display: inline-block;
    color: var(--color-primary);
    font-weight: bold;
    margin-bottom: 10px;
    margin-right: 15px;
    font-size: 1.1em;
    vertical-align: middle;
}

/* Enchant Quality Radio Buttons */
.enchant-quality-radios {
    display: inline-flex;
    gap: 1%;
    vertical-align: middle;
}

.quality-radio {
    display: none; /* Hide actual radio input */
}

.quality-radio-label {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #333;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.quality-radio-label:hover {
    transform: scale(1.15);
    /*border-color: #666;*/
}

/* Quality-specific colors */
.quality-radio-label.white {
    background-color: #ffffff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.quality-radio-label.green {
    background-color: #1eff00;
    box-shadow: 0 0 4px rgba(30, 255, 0, 0.3);
}

.quality-radio-label.blue {
    background-color: #0070ff;
    box-shadow: 0 0 4px rgba(0, 112, 255, 0.3);
}

.quality-radio-label.purple {
    background-color: #a335ee;
    box-shadow: 0 0 4px rgba(163, 53, 238, 0.3);
}

.quality-radio-label.gold {
    background-color: #ffd700;
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
}

/* Selected state - add inner dot */
.quality-radio:checked + .quality-radio-label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: #000;
    border-radius: 50%;
}

.quality-radio:checked + .quality-radio-label {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px currentColor;
    transform: scale(1.1);
}

/* Special layout for enchant label with radios */
.enchant-label-with-radios {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    margin-right: 0 !important;
}

.enchant-label-text {
    flex-shrink: 0;
}

.enchant-quality-radios {
    margin-left: auto; /* Push to right */
}

/* Enchant Quality Radio Buttons */
.enchant-quality-radios {
    display: inline-flex;
    gap: 4px;
    margin-left: 12px;
    vertical-align: middle;
}

.quality-radio {
    display: none; /* Hide actual radio input */
}

.quality-radio-label {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #333;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.quality-radio-label:hover {
    transform: scale(1.15);
    border-color: #666;
}

/* Quality-specific colors */
.quality-radio-label.white {
    background-color: #ffffff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.quality-radio-label.green {
    background-color: #1eff00;
    box-shadow: 0 0 4px rgba(30, 255, 0, 0.3);
}

.quality-radio-label.blue {
    background-color: #0070ff;
    box-shadow: 0 0 4px rgba(0, 112, 255, 0.3);
}

.quality-radio-label.purple {
    background-color: #a335ee;
    box-shadow: 0 0 4px rgba(163, 53, 238, 0.3);
}

.quality-radio-label.gold {
    background-color: #ffd700;
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
}

/* Selected state - add inner dot */
.quality-radio:checked + .quality-radio-label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: #000;
    border-radius: 50%;
}

.quality-radio:checked + .quality-radio-label {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px currentColor;
    transform: scale(1.1);
}

/* Quality Selector */
.quality-selector {
    display: inline-flex;
    gap: 15px;
    flex-wrap: wrap;
    vertical-align: middle;
}
/* Quality section horizontal layout */
.quality-config {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.quality-default-checkbox {
    flex-shrink: 0;
}

.quality-default-checkbox .checkbox-label {
    margin-top: 16px;
    margin-bottom: 15px;
}

.quality-btn {
    padding: 8px 16px;
    background: rgba(42, 42, 42, 0.9);
    border: 2px solid #444;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.quality-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.quality-btn.active {
    transform: scale(1.05);
    background-color: #1a1a1a;
}

/* Quality-specific glow effects for active state */
.quality-btn[data-quality="white"].active {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.quality-btn[data-quality="green"].active {
    border-color: #1eff00;
    box-shadow: 0 0 10px rgba(30, 255, 0, 0.6);
}

.quality-btn[data-quality="blue"].active {
    border-color: #0070ff;
    box-shadow: 0 0 10px rgba(0, 112, 255, 0.6);
}

.quality-btn[data-quality="purple"].active {
    border-color: #a335ee;
    box-shadow: 0 0 10px rgba(163, 53, 238, 0.6);
}

.quality-btn[data-quality="gold"].active {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.quality-btn[data-quality="gold"].active.mythic {
    border-color: #ff8800;
    box-shadow: 0 0 15px rgba(255, 136, 0, 0.7);
}

/* Quality-specific colors */
.quality-btn[data-quality="white"] {
    color: #ffffff;
}
.quality-btn[data-quality="white"].selected {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.quality-btn[data-quality="green"] {
    color: #1eff00;
}
.quality-btn[data-quality="green"].selected {
    border-color: #1eff00;
    box-shadow: 0 0 10px rgba(30, 255, 0, 0.3);
}

.quality-btn[data-quality="blue"] {
    color: #0070ff;
}
.quality-btn[data-quality="blue"].selected {
    border-color: #0070ff;
    box-shadow: 0 0 10px rgba(0, 112, 255, 0.3);
}

.quality-btn[data-quality="purple"] {
    color: #a335ee;
}
.quality-btn[data-quality="purple"].selected {
    border-color: #a335ee;
    box-shadow: 0 0 10px rgba(163, 53, 238, 0.3);
}

.quality-btn[data-quality="gold"] {
    color: #ffd700;
}
.quality-btn[data-quality="gold"].selected {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.quality-btn.mythic {
    background: linear-gradient(135deg, #ff6b00, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.quality-btn[data-quality="mythic"].selected {
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(42, 42, 42, 0.9), rgba(42, 42, 42, 0.9)),
                      linear-gradient(135deg, #ff6b00, #ffaa00);
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.5);
}

/* Trait and Enchant Selectors */
.config-select {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--color-text);
    border: 1px solid #666;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s;
}

.config-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.config-select option {
    background: #1a1a1a;
    color: var(--color-text);
}

/* Bonus Preview */
.trait-bonus-preview,
.enchant-bonus-preview {
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid var(--color-secondary);
    border-radius: 3px;
    font-size: 0.9em;
    color: #00ff00;
    min-height: 20px;
}

.bonus-text {
    color: #00ff00;
    text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.8);
}

.bonus-text.white { color: #ffffff; }
.bonus-text.green { color: #1eff00; }
.bonus-text.blue { color: #0070ff; }
.bonus-text.purple { color: #a335ee; }
.bonus-text.gold { color: #ffd700; }
.bonus-text.mythic { 
    background: linear-gradient(135deg, #ff6b00, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Quality text colors for total bonus preview */
.quality-text.white { color: #ffffff; }
.quality-text.green { color: #1eff00; }
.quality-text.blue { color: #0070ff; }
.quality-text.purple { color: #a335ee; }
.quality-text.gold { color: #ffd700; }
.quality-text.mythic {
    background: linear-gradient(135deg, #ff6b00, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.checkbox-label {
    margin-top: 10px;
    margin-left: 15px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid var(--color-secondary);
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.5);
    min-height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer; 
}

.checkbox-label input[type="checkbox"] {

    margin-right: 15px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===============================================
   QUICK EQUIP BUTTON
   =============================================== */

.btn-quick-equip {
    padding: 10px 20px;
    background-color: #1a1a1a;
    color: #ffd700;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    border: 3px solid #ffd700;
    margin-right: auto;
    box-shadow: 0 0 7px #ffd700;
}

.btn-quick-equip:hover {
    background: linear-gradient(135deg, #1eff00 0%, #ffffff 100%);
    transform: scale(1.05);
    color: #000000;
    border: 3px solid #000000;
    box-shadow: 0 0 10px #1eff00;
}

.btn-quick-equip:active {
    transform: scale(0.98);
}

.btn-quick-equip:disabled {
    background: #1a1a1a;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #640d0dff;
    box-shadow: 0 0 7px #640d0dff;
}

.btn-quick-equip:disabled:hover {
    transform: none;
    background: #640d0dff;
}

/* ===============================================
   FOOTER
   =============================================== */

.gear-editor-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 20px;
    background: linear-gradient(to right, #2a2a2a, var(--color-secondary));
    border-top: 1px solid var(--color-secondary);
    border-radius: 0 0 22px 22px;
}

.gear-editor-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.gear-editor-footer .btn-cancel {
    background: #666;
    color: var(--color-text);
    border: 1px solid #999;
}

.gear-editor-footer .btn-cancel:hover {
    background: #777;
    transform: scale(1.02);
}

.gear-editor-footer .btn-apply {
    background: linear-gradient(135deg, var(--color-primary), #8b7355);
    color: var(--color-background);
    border: 1px solid var(--color-primary);
}

.gear-editor-footer .btn-primary:hover {
    /*background: linear-gradient(135deg, #ffcc00, #9d8a6e);*/
    box-shadow: 0 0 4px var(--color-primary);
    transform: scale(1.02);
}

.gear-editor-footer .btn-primary:disabled {
    background: #640d0dff;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.6;
}

.gear-editor-footer .btn-primary:disabled:hover {
    background: #640d0dff;
    transform: none;
    box-shadow: none;
}



/* ===============================================
   SCROLLBAR STYLING
   =============================================== */

.gear-editor-content::-webkit-scrollbar {
    width: 8px;
}

.gear-editor-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.gear-editor-content::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 4px;
}

.gear-editor-content::-webkit-scrollbar-thumb:hover {
    background: #6a5728;
}

/* ===============================================
   RESPONSIVE
   =============================================== */

@media (max-width: 1200px) {
    .gear-editor-window {
        width: 60%;
        left: 20%;
    }
}

@media (max-width: 768px) {
    .gear-editor-window {
        width: 90%;
        left: 5%;
        top: 10%;
        max-height: 80%;
    }
}

/* ===============================================
   ANIMATIONS
   =============================================== */

@keyframes editor-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gear-editor-window {
    animation: editor-fade-in 0.2s ease-out;
}

/* ===============================================
   END OF GEAR EDITOR STYLES
   =============================================== */