/* ===============================================
   Vengeance Module Styles (U50 Phase 7)
   Elder Spores Online
   Modeled on the Scribing Station modal layout.
   Window: left = chosen slots, center = active slot
   options (with inline stat bonuses), right = preview.
   =============================================== */

/* ===== Modal Shell ===== */
.vengeance-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.vengeance-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
}

.vengeance-selector-window {
    position: absolute;
    left: 20.5%;
    top: 17%;
    width: 59%;
    height: 75.5%;
    max-height: 800px;
    background-image: url('/graphics/vengeance_perks_background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--color-secondary);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    z-index: 2500;
}

.vengeance-selector-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: 30px 30px 0 0;
}

.vengeance-selector-header h2 {
    margin: 0;
    color: var(--color-primary);
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.vengeance-selector-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;
}

.vengeance-selector-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.vengeance-selector-content {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.vengeance-left-panel h3,
.vengeance-center-panel h3,
.vengeance-right-panel h3 {
    color: var(--color-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 15px;
    text-align: center;
}

/* ===== Left Panel - Chosen Slots ===== */
.vengeance-left-panel {
    width: 25%;
    background: linear-gradient(to bottom, rgb(0, 0, 0) 35%, rgba(10, 10, 10, 0.0));
    border-radius: 20px;
    padding: 15px;
    overflow-y: hidden;
}

.veng-slot {
    position: relative;
    width: 100%;
    min-height: 95px;
    margin-bottom: 15px;
    background: rgba(42, 42, 42, 0.7);
    border: 2px solid #666;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    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);
}

.veng-slot:hover {
    box-shadow: 0 0 10px var(--color-primary);
    transform: scale(1.02);
}

/* Active slot = the one being edited. Only border + shadow change so the
   panel keeps the build-editor's neutral look (no background fill that
   hurts label readability). */
.veng-slot.active-slot {
    border-color: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary);
}

/* Occupied slots keep the neutral background; the filled name is the only
   visual cue beyond the active border. */
.veng-slot.occupied {
    border-color: #888;
}

.veng-slot .veng-slot-type {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.veng-slot .veng-slot-name {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
}

/* Selected-value colors match the build editor's left Vengeance rows */
.veng-slot[data-slot-type="loadout"] .veng-slot-name { color: var(--color-text-beige); }
.veng-slot[data-slot-type="perk-red"] .veng-slot-name { color: #ff4d4d; }
.veng-slot[data-slot-type="perk-yellow"] .veng-slot-name { color: #ffd700; }
.veng-slot[data-slot-type="perk-blue"] .veng-slot-name { color: #4d90ff; }

/* Default placeholder name when empty */
.veng-slot .veng-slot-name.empty {
    color: #888;
    font-style: italic;
    font-weight: normal;
}

/* ===== Center Panel - Available Options ===== */
.vengeance-center-panel {
    flex: 0 0 38%;
    background: linear-gradient(to bottom, #000000a0 25%, #00000000) 55%;
    border-radius: 25px;
    padding: 15px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-secondary) #1a1a1a;
    text-shadow:
        0 0px 5px rgba(0, 0, 0, 1),
        0 0px 10px rgba(0, 0, 0, 1),
        0 0px 15px rgba(0, 0, 0, 1);
}

.veng-option-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.veng-option {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 8px 12px;
    background: rgba(24, 24, 24, 0.7);
    border: 1px solid #444;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition-fast);
    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);
}

.veng-option:hover {
    background: rgba(69, 69, 69, 0.9);
    border-color: var(--color-primary);
}

.veng-option.selected {
    background: rgba(10, 74, 10, 0.7);
    border-color: var(--color-success);
}

.veng-option-name {
    font-size: 16px;
    font-weight: bold;
    color: #ccc;
    margin-bottom: 4px;
    text-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);
}

.veng-option.selected .veng-option-name {
    color: var(--color-primary);
}

/* Loadout option names use green to stay distinct from the gold default
   and the R/Y/B perk accents. */
.vengeance-center-panel .veng-option:not([class*="veng-opt-"]) .veng-option-name {
    color: var(--color-success);
}

/* Color-group accents for perk option names */
.veng-option.veng-opt-red .veng-option-name { color: #ff4d4d; }
.veng-option.veng-opt-yellow .veng-option-name { color: #ffd700; }
.veng-option.veng-opt-blue .veng-option-name { color: #4d90ff; }

.veng-option.selected.veng-opt-red .veng-option-name,
.veng-option.selected.veng-opt-yellow .veng-option-name,
.veng-option.selected.veng-opt-blue .veng-option-name {
    color: var(--color-primary);
}

/* Inline stat-bonus lines on each option card */
.veng-option-bonuses {
    font-size: 13px;
    color: #ddd;
    line-height: 1.4;
}

.veng-option-bonuses p {
    margin: 0;
}

/* Loadout option names use green to stay distinct from the gold header and
   the R/Y/B perk accents. Loadout cards have no veng-opt-* color class. */
.vengeance-center-panel .veng-option:not([class*="veng-opt-"]) .veng-option-name {
    color: var(--color-success);
}

/* Right-panel summary sections (one per active selection) */
.veng-summary-section {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.veng-summary-section:last-child {
    border-bottom: none;
}

.veng-summary-title {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 6px;
    color: var(--color-primary);
}

.veng-summary-loadout .veng-summary-title { color: var(--color-success); }
.veng-summary-red .veng-summary-title { color: #ff4d4d; }
.veng-summary-yellow .veng-summary-title { color: #ffd700; }
.veng-summary-blue .veng-summary-title { color: #4d90ff; }

/* ===== Right Panel - Preview ===== */
.vengeance-right-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.0);
    border-radius: 8px;
    padding: 20px 10px 20px 5px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-secondary) #1a1a1a;
    text-shadow:
        0 0px 5px rgba(0, 0, 0, 1),
        0 0px 10px rgba(0, 0, 0, 1),
        0 0px 15px rgba(0, 0, 0, 1);
}

.veng-preview-tooltip {
    background: linear-gradient(to bottom, #1a1a1a, #0d0d0d);
    border: 2px solid #444;
    border-radius: 20px;
    padding: 15px;
    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);
}

.veng-preview-name {
    color: var(--color-primary);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444;
}

.veng-preview-body p {
    color: #ddd;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    margin: 6px 0;
    text-shadow:
        0 0px 5px rgba(0, 0, 0, 1),
        0 0px 10px rgba(0, 0, 0, 1),
        0 0px 15px rgba(0, 0, 0, 1);
}

.veng-preview-body p.no-selection {
    color: #ff3333;
    font-style: italic;
}

/* ===== Footer ===== */
.vengeance-selector-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 15px 20px;
    background: #2a2a2a;
    border-top: 1px solid var(--color-primary);
    border-radius: 0 0 8px 8px;
}

/* TEMP: in-development scrolling notice — remove when perk parsing finalized.
   Sits left of the Close button; track holds two identical copies and slides
   -50% for a seamless loop. Hover pauses so users can read it. */
.veng-notice-bar {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.veng-notice-track {
    display: inline-flex;
    width: max-content;
    animation: veng-notice-scroll 38s linear infinite;
}

.veng-notice-text {
    display: inline-block;
    padding: 0 3rem;
    font-size: 18px;
    color: #ffd27a;
    letter-spacing: 0.3px;
}

.veng-notice-bar:hover .veng-notice-track {
    animation-play-state: paused;
}

@keyframes veng-notice-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
    .vengeance-selector-window {
        position: fixed;
        top: 3%;
        left: 3%;
        width: 94%;
        height: 91%;
        max-height: none;
        border-radius: 20px;
    }

    .vengeance-selector-header {
        border-radius: 20px 20px 0 0;
        padding: 12px 16px;
        flex-shrink: 0;
    }

    .vengeance-selector-header h2 {
        font-size: 1.1rem;
    }

    .vengeance-selector-content {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

    /* Preview first */
    .vengeance-right-panel {
        order: 1;
        flex: 0 0 auto;
        padding: 10px;
        overflow-y: visible;
    }

    /* Chosen slots second, horizontal row */
    .vengeance-left-panel {
        order: 2;
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
        border-radius: 14px;
        overflow-y: visible;
        flex-shrink: 0;
    }

    .vengeance-left-panel h3 {
        display: none;
    }

    .veng-slot {
        flex: 1;
        min-height: 90px;
        margin-bottom: 0;
        padding: 8px 4px;
        border-radius: 10px;
    }

    .veng-slot .veng-slot-name {
        font-size: 14px;
    }

    /* Options third */
    .vengeance-center-panel {
        order: 3;
        flex: 0 0 auto;
        overflow-y: visible;
        padding: 10px;
        border-radius: 14px;
    }

    .veng-option {
        padding: 8px 10px;
        border-radius: 10px;
    }

    .vengeance-selector-footer {
        flex-shrink: 0;
        padding: 10px 16px;
        border-radius: 0 0 20px 20px;
    }

    .veng-notice-text {
        font-size: 12px;
        padding: 0 2rem;
    }
}
