/* Custom Confirmation Modal Styles */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Darker overlay for better focus */
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Ensure it's on top of everything */
    pointer-events: auto;
}

/* Virš .lw-gem-modal (12040) ir .lw-gem-modal--nested (12060), kad Slotai / klaidos matytųsi */
#customConfirmModal.modal-overlay {
    z-index: 13080;
}

.modal-overlay.no-darken {
    background-color: transparent;
    pointer-events: none; /* Allow clicking through the overlay */
}

.modal-overlay.no-darken .modal-content {
    pointer-events: auto; /* But keep content clickable */
}

.modal-content {
    background: rgba(30, 30, 30, 0.95);
    padding: 15px; /* Reduced padding */
    border-radius: 12px;
    border: 2px solid #4a4a4a;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    width: 90%;
    max-width: 400px;
    text-align: center;
    color: #e0e0e0;
}

.modal-content .info-modal-message {
    margin-bottom: 12px;
    font-size: 0.95em;
    color: #e0e0e0;
    text-align: left;
    line-height: 1.2;
}

.modal-content .info-modal-message .tooltip-header {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 2px;
    text-align: left;
    /* Color will be set by rarity class */
}

.modal-content .info-modal-message .tooltip-rarity {
    font-size: 0.9em;
    font-weight: bold;
    font-style: italic;
    color: #b0b0b0;
    margin-top: 0px;
    margin-bottom: 2px;
    text-align: left;
}

.modal-content .info-modal-message .tooltip-divider {
    height: 1px;
    background-color: #6a5a4a;
    margin: 3px 0;
}

.modal-content .info-modal-message .tooltip-slot {
    font-style: italic;
    color: #b0b0b0;
    margin-bottom: 2px;
    text-align: left;
}

.modal-content .info-modal-message .tooltip-attributes ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.modal-content .info-modal-message .tooltip-attributes li {
    margin-bottom: 2px;
    color: #60a030;
}

.modal-content .info-modal-message .tooltip-description {
    font-style: italic;
    color: #b0b0b0;
    margin-top: 8px;
    font-size: 0.9em;
    text-align: left;
}

.modal-content .info-modal-message .tooltip-attributes + .tooltip-description,
.tooltip-attributes + .tooltip-description {
    margin-top: 10px;
}

.modal-content .info-modal-message p {
    margin: 0; /* Remove default paragraph margins within the info modal */
    text-align: left;
    color: #e0e0e0; /* Default text color for paragraphs in info modal */
    font-size: 0.9em;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.modal-buttons button {
    display: block;
    min-width: 120px;
    flex: 1 1 120px;
    width: auto;
    padding: 10px 20px;
    background: #4a3a2a;
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #6a5a4a;
    box-shadow: 0 3px 5px rgba(0,0,0,0.4);
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: bold;
    font-family: var(--player-font, 'Cinzel Decorative'), cursive, Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
}

.modal-buttons button:hover {
    background: #6a4a3a;
    transform: translateY(-2px);
    box-shadow: 0 5px 8px rgba(0,0,0,0.6);
}

.modal-buttons button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.4);
}

/* Specific styles for custom confirm modal buttons */
.modal-buttons .confirm-yes-button {
    background: #4a3a2a; /* Dark brown/earthy tone for Yes button */
}

.modal-buttons .confirm-yes-button:hover {
    background: #6a4a3a;
}

.modal-buttons .confirm-yes-button.confirm-success {
    background: #2f7d32;
    border-color: #46a34b;
}

.modal-buttons .confirm-yes-button.confirm-success:hover {
    background: #3d9441;
}

.modal-buttons .confirm-alt-button {
    background: #4a3a2a;
    border-color: #6a5a4a;
}

.modal-buttons .confirm-alt-button:hover {
    background: #6a4a3a;
}

.modal-buttons .confirm-yes-button.confirm-destructive {
    background: #a03030; /* Red for destructive Yes button */
    border-color: #c04040;
}

.modal-buttons .confirm-yes-button.confirm-destructive:hover {
    background: #c04040;
}

.modal-buttons .confirm-no-button {
    background: #4a3a2a; /* Dark brown/earthy tone for No button */
    border-color: #6a5a4a;
}

.modal-buttons .confirm-no-button:hover {
    background: #6a4a3a;
}

.modal-overlay.talent-upgrade-modal .modal-content {
    max-width: 460px;
}

.modal-overlay.talent-upgrade-modal .modal-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.modal-overlay.talent-upgrade-modal .modal-buttons button {
    width: 50%;
    min-width: 0;
    flex: none;
    padding: 12px 16px;
    font-size: 0.95em;
    letter-spacing: 1.2px;
    align-self: center;
}

.modal-overlay.talent-upgrade-modal .modal-buttons .confirm-yes-button {
    background: #4a3a2a;
    border-color: #8b7748;
    color: #f1e3b0;
}

.modal-overlay.talent-upgrade-modal .modal-buttons .confirm-yes-button:hover {
    background: #6a4a3a;
}

.modal-overlay.talent-upgrade-modal .modal-buttons .confirm-alt-button {
    background: #3f3428;
    border-color: #6a5a4a;
    color: #e0d2aa;
}

.modal-overlay.talent-upgrade-modal .modal-buttons .confirm-alt-button:hover {
    background: #5a4331;
}

.modal-overlay.talent-upgrade-modal .modal-buttons .confirm-no-button {
    background: #453126;
    border-color: #705446;
    color: #d8c6b0;
}

.modal-overlay.talent-upgrade-modal .modal-buttons .confirm-no-button:hover {
    background: #5c4030;
}

/* Item Tooltip Styles */
#item-tooltip {
    position: fixed; /* viewport / clientX clientY atitinka fiksuotą poziciją */
    background-color: rgba(30, 30, 30, 0.95); /* Darker, semi-transparent background */
    border: 1px solid #c0a060; /* Golden border */
    padding: 8px 12px;
    color: #e0e0e0; /* Light text for readability */
    font-family: var(--player-font, 'Cinzel Decorative'), cursive, Arial, sans-serif; /* Use your game's font */
    z-index: 99999; /* Ensure it's on top */
    pointer-events: none; /* Allows mouse events to pass through the tooltip to elements beneath it */
    min-width: 220px; /* Adjust as needed */
    max-width: min(92vw, 420px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7); /* Optional: subtle shadow */
    display: none; /* Hidden by default */
    line-height: 1.2;
    text-align: left; /* Align tooltip content to the left */
}

.item-tooltip-hidden {
    display: none !important;
}

.item-tooltip-visible {
    display: block !important;
    opacity: 1 !important; /* Ensure full opacity */
}

.tooltip-header {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 2px;
    text-align: left;
}

.tooltip-rarity {
    font-size: 0.9em;
    font-weight: bold;
    text-align: left;
    margin-bottom: 2px;
}

.tooltip-divider {
    height: 1px;
    background-color: #6a5a4a; /* Darker brown divider */
    margin: 5px 0;
}

.tooltip-slot {
    font-style: italic;
    color: #b0b0b0; /* Slightly darker text for slot */
    margin-bottom: 2px;
    text-align: left;
}

.tooltip-attributes ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.tooltip-attributes li {
    margin-bottom: 2px;
    color: #60a030; /* Green for positive attributes */
    text-align: left;
}

.tooltip-description {
    font-style: italic;
    color: #b0b0b0; /* Slightly darker text for description */
    margin-top: 4px;
    font-size: 0.9em;
    text-align: left;
}

.tooltip-description .lw-item-tradable-divider,
.modal-content .info-modal-message .tooltip-description .lw-item-tradable-divider {
    margin-top: 8px;
    margin-bottom: 6px;
}

.tooltip-description .lw-item-tradable-line,
.modal-content .info-modal-message .tooltip-description .lw-item-tradable-line {
    font-style: normal;
    font-size: 0.95em;
}

/* Upgrade slots: B | S breakdown + gem sockets (info modal / tooltip) */
.item-upgrade-attr-row {
    list-style: none;
    margin: 4px 0;
    padding: 4px 0;
    border-bottom: 1px solid rgba(90, 80, 70, 0.35);
    font-size: 0.92em;
    line-height: 1.35;
}

/* Vengti dvigubos linijos: silpnas row border + sekcijos skirtukas */
.item-upgrade-attr-row:has(+ .item-upgrade-attr-divider) {
    border-bottom: none;
}

.tooltip-attributes li.item-upgrade-attr-row:last-child,
.modal-content .info-modal-message .tooltip-attributes li.item-upgrade-attr-row:last-child {
    border-bottom: none;
}

.item-upgrade-attr-divider {
    list-style: none;
    height: 0;
    margin: 8px 0 6px;
    padding: 0;
    border: none;
    border-top: 1px solid rgba(130, 120, 110, 0.55);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.item-attr-base {
    color: #c8c8c8;
    font-weight: 600;
}
.item-attr-sum {
    color: #e8e8e8;
    margin: 0 2px;
}
.item-upgrade-attr-row--bonused .item-attr-base {
    color: #a8d8a6;
}

.item-upgrade-attr-row--bonused .item-attr-sum.item-attr-sum--bonused {
    color: #7ede7e;
    font-weight: 600;
}

.item-attr-addon--enchant {
    color: #8fdf8f;
    margin-left: 3px;
}
.item-attr-addon--inscription {
    color: #c89fff;
    margin-left: 3px;
}
.item-attr-addon--gems {
    color: #ffb347;
    margin-left: 3px;
}
.item-gem-sockets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 4px;
}
.item-gem-socket {
    width: 28px;
    height: 28px;
    border: 2px dashed #7a7060;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}
.item-gem-socket-filled {
    border-style: solid;
    border-color: #ffb347;
    padding: 2px;
}
.item-gem-socket-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* Hover tooltip — šiek tiek mažesni lizdai nei info modale (#tooltip-gem-sockets-host) */
#tooltip-gem-sockets-host .item-gem-sockets {
    gap: 4px;
    margin: 6px 0 2px;
}
#tooltip-gem-sockets-host .item-gem-socket {
    width: 22px;
    height: 22px;
    border-width: 1px;
    border-radius: 3px;
}
#tooltip-gem-sockets-host .item-gem-socket-filled {
    padding: 1px;
}

details.bon-breakdown-expand > summary {
    cursor: pointer;
    list-style: none;
}
details.bon-breakdown-expand > summary::-webkit-details-marker {
    display: none;
}
.bon-breakdown-sub {
    margin: 4px 0 0 10px;
    padding: 0;
    list-style: disc;
    font-size: 0.9em;
}
.bon-breakdown--base { color: #bdbdbd; }
.bon-breakdown--enchant { color: #8fdf8f; }
.bon-breakdown--inscription { color: #c89fff; }
.bon-breakdown--gems { color: #ffb347; }

/* --- Gem socket UI (informacija → Slotai) --- */
.lw-gem-modal {
    position: fixed;
    inset: 0;
    z-index: 12040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}
.lw-gem-modal[hidden] {
    display: none !important;
}
.lw-gem-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}
.lw-gem-modal__backdrop--dim {
    background: rgba(0, 0, 0, 0.45);
}
.lw-gem-modal--nested {
    z-index: 12060;
}
.lw-gem-modal__panel {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
    background: linear-gradient(180deg, #2a2318 0%, #1a1510 100%);
    border: 2px solid #6a5a4a;
    border-radius: 8px;
    padding: 16px 18px 14px;
    color: #e8dcc8;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}
.lw-gem-modal__panel--pick {
    max-width: 480px;
}
.lw-gem-modal__title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: #f0e6d2;
}
.lw-gem-modal__subtitle {
    margin: 0 0 12px;
    font-size: 0.88rem;
    color: #b5a890;
    line-height: 1.35;
}
.lw-gem-modal__slot-host .item-gem-sockets {
    justify-content: center;
    align-items: center;
}
.lw-gem-modal__slot-host .item-gem-socket {
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.12s ease;
}
/* Modale aiški „spalva — tuščias“ rodoma tekstu; įdėjus gemą — kvadratas su ikona */
.lw-gem-modal__slot-host .item-gem-socket-filled {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.lw-gem-modal__slot-host .item-gem-socket--empty {
    width: auto;
    min-width: 94px;
    max-width: 140px;
    min-height: 58px;
    height: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.2;
}
.lw-gem-slot-empty-color {
    font-size: 0.72rem;
    font-weight: 600;
    color: #efe6d8;
    text-align: center;
    word-break: break-word;
}
.lw-gem-slot-empty-state {
    font-size: 0.64rem;
    color: #a08f7a;
}
.lw-gem-modal__slot-host .item-gem-socket:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 2px rgba(255, 179, 71, 0.35);
}
.lw-gem-modal__hint {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: #8a7d6e;
}
.lw-gem-modal__footer {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}
.lw-gem-btn {
    padding: 8px 14px;
    border-radius: 4px;
    border: 1px solid #5a5044;
    background: rgba(0, 0, 0, 0.25);
    color: #e8dcc8;
    cursor: pointer;
    font-size: 0.9rem;
}
.lw-gem-btn:hover {
    border-color: #8a7860;
    background: rgba(255, 255, 255, 0.06);
}
.lw-gem-btn--primary {
    border-color: #6a9030;
    background: rgba(96, 160, 48, 0.25);
}
.lw-gem-btn--primary:hover {
    background: rgba(96, 160, 48, 0.4);
}
.lw-gem-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
    max-height: min(360px, 50vh);
    overflow-y: auto;
    padding: 4px 2px;
}
.lw-gem-pick-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border: 2px dashed #7a7060;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    color: #c9bba8;
    font-size: 0.72rem;
    text-align: center;
}
.lw-gem-pick-cell:hover {
    border-style: solid;
    border-color: #c9a860;
}
.lw-gem-pick-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 3px;
}
.lw-gem-pick-meta {
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

