/* waifu-wars/css/base.css - Global styles, fonts, and common components */

:root {
    --theme-bg-color: rgba(30, 25, 20, 0.95);
    --theme-border-color: #a08c6d;
    --theme-primary-text-color: #e6c891; /* Gold */
    --theme-secondary-text-color: #c9b79c; /* Tan */
    --theme-body-text-color: #ffffff;
    --theme-panel-bg-color: rgba(0,0,0,0.3);
    
    --theme-button-wrapper-bg: rgba(0, 0, 0, 0.3);
    --theme-button-wrapper-border: #7c6c4d;

    --theme-button-bg: rgba(0, 0, 0, 0.4);
    --theme-button-hover-bg: rgba(230, 200, 145, 0.2);
    --theme-button-active-bg: rgba(230, 200, 145, 0.4);
    --theme-button-disabled-bg: #444;
    --theme-button-disabled-color: #888;
}


body {
    margin: 0;
    overflow: hidden;
    background: black;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.button-wrapper {
    background: var(--theme-button-wrapper-bg);
    padding: 3px;
    border-radius: 8px;
    display: inline-block;
    backdrop-filter: blur(5px);
    border: 1px solid var(--theme-button-wrapper-border);
}

.menu-btn {
    padding: 10px 20px;
    border-radius: 5px;
    background: var(--theme-button-bg);
    color: var(--theme-body-text-color);
    border: 1px solid var(--theme-border-color);
    cursor: pointer;
    transition: background 0.3s;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}

.menu-btn:hover:not(:disabled) {
    background: var(--theme-button-hover-bg);
}
.menu-btn:disabled {
    background: var(--theme-button-disabled-bg);
    color: var(--theme-button-disabled-color);
    border-color: #555;
    cursor: not-allowed;
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--theme-bg-color);
    color: var(--theme-body-text-color);
    padding: 20px;
    border-radius: 10px;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease;
    max-width: 80vw;
    border: 1px solid var(--theme-border-color);
    backdrop-filter: blur(5px);
}

.popup-close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: var(--theme-secondary-text-color);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s;
}
.popup-close-btn:hover {
    color: var(--theme-body-text-color);
}


/* Shared styles for Waifu Stats Popup */
.waifu-stats-popup h3, .waifu-stats-popup h4 {
    color: var(--theme-primary-text-color);
}
.waifu-stats-popup .spell-entry-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}
.waifu-stats-popup .spell-info {
    flex-grow: 1;
    margin-right: 10px;
}
.waifu-stats-popup .spell-name {
    font-weight: bold;
    display: block;
}
.waifu-stats-popup .spell-desc {
    font-size: 0.9em;
    color: #ccc;
}
.waifu-stats-popup .spell-upgrade-btn {
    padding: 4px 8px;
    font-size: 12px;
    flex-shrink: 0;
}
.waifu-stats-popup .spell-upgrade-btn .gem-cost {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Generic Filter Bar Style */
.filter-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-bottom: 1px solid var(--theme-border-color);
    backdrop-filter: blur(5px);
    flex-wrap: wrap;
    box-sizing: border-box;
}

.filter-bar input[type="text"], .filter-bar select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid var(--theme-border-color);
    background: var(--theme-bg-color);
    color: var(--theme-body-text-color);
    font-size: 14px;
}
.filter-bar input[type="text"]::placeholder {
    color: var(--theme-secondary-text-color);
}

.filter-bar > div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-bar label {
    color: var(--theme-secondary-text-color);
    font-size: 14px;
}

/* === NEW UNIVERSAL TOOLTIP === */
.item-tooltip-global {
    position: fixed; /* Use fixed to escape parent containers */
    background: rgba(0,0,0,0.85);
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #555;
    width: 180px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s linear 0.5s; /* Delay on appearance */
    z-index: 100;
    color: var(--theme-body-text-color);
}
.item-tooltip-global h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--theme-primary-text-color);
}
.item-tooltip-global p {
    margin: 2px 0;
    color: #a0e8ff;
}
.item-tooltip-global .rarity-Common { color: #fff; }
.item-tooltip-global .rarity-Rare { color: #5b92e5; }
.item-tooltip-global .rarity-Epic { color: #9400d3; }
.item-tooltip-global .rarity-Legendary { color: #ff8c00; }
.item-tooltip-global .rarity-Mythic { color: #ffd700; }


/* === NEW UNIVERSAL GRID & ITEM STYLES === */
.item-grid-universal {
    background: var(--theme-panel-bg-color);
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    align-content: start;
    flex-grow: 1;
}

.grid-item-universal {
    width: 100px;
    height: 100px;
    background-color: rgba(255,255,255,0.1);
    border: 1px solid var(--theme-button-wrapper-border);
    border-radius: 5px;
    background-size: 80%;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    justify-self: center; /* Center items in their grid cell */
}

.grid-item-universal:hover,
.grid-item-universal.selected {
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--theme-primary-text-color);
    border-color: var(--theme-primary-text-color);
    z-index: 10;
}

/* Indicators for grid items */
.equipped-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: var(--theme-primary-text-color);
    font-size: 10px;
    padding: 2px 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.level-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid #ffd700;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--theme-panel-bg-color);
    border-radius: 10px;
    border: 1px solid var(--theme-button-wrapper-border);
}

::-webkit-scrollbar-thumb {
    background: var(--theme-border-color);
    border-radius: 10px;
    border: 2px solid var(--theme-panel-bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary-text-color);
}

::-webkit-scrollbar-corner {
    background: transparent;
}