/* ===== BUILD MANAGER - LOADING OVERLAY ===== */

.build-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    transition: opacity 0.3s ease;
}

.build-loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
    color: #ffd700;
    padding: 40px;
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #ffd700;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.loading-step {
    font-size: 14px;
    color: #999;
    margin: 0;
    min-height: 20px;
}

/* ===== BUILD MANAGER MODAL ===== */

.build-manager-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.build-manager-modal.hidden {
    display: none;
}

.build-manager-window {
    width: 800px;
    max-width: 90vw;
    height: 600px;
    max-height: 85vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #ffd700;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

/* Header */
.build-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ffd700;
    /* background: rgba(0, 0, 0, 0.3); */
    background: linear-gradient(to right, var(--color-secondary), #2a2a2a);
    border-radius: 8px 8px 0 0;
}

.build-manager-header h2 {
    margin: 0;
    color: #ffd700;
    font-size: 22px;
    text-shadow: -3px -3px 5px #00000050, 3px -3px 5px #00000050, -3px 3px 5px #00000050, 3px 3px 5px #00000050;
}

.build-manager-close {
    background: none;
    border: none;
    color: #ffd700;
    font-size: 28px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.build-manager-close:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

/* Content Area */
.build-manager-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-image: url('/graphics/scribing_background.png');
    background-size: cover;
    background-position: center;
}

/* Left Panel - Build List */
.build-manager-left {
    width: 45%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 215, 0, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.build-list-header {
    padding: 12px 15px;
    color: #ccc;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-between;
}

.build-count {
    color: #888;
}

/* Build Name Input */
.build-name-input-container {
    padding: 10px 15px;
    /* border-bottom: 1px solid rgba(255, 215, 0, 0.2); */
}

.build-name-input-container.hidden {
    display: none;
}

.build-name-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 1);
    border: 1px solid #888888;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.build-name-input:focus {
    outline: none;
    border-color: rgba(21, 255, 0, 0.8);
    box-shadow: 0 0 10px rgba(21, 255, 0, 0.4);
}

.build-name-input::placeholder {
    color: #666;
}

/* Build List */
.build-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.build-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.build-list-empty {
    color: #666;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
    text-shadow: -2px -2px 3px #000, 2px -2px 3px #000, -2px 2px 3px #000, 2px 2px 3px #000;
}

.build-list-item {
    padding: 12px 15px;
    background: rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.build-list-item:hover {
    background: rgba(21, 255, 0, 0.3);
    border-color: rgba(21, 255, 0, 0.6);
}

.build-list-item.selected {
    background: rgba(21, 255, 0, 0.5);
    border-color: rgba(21, 255, 0, 0.8);
    box-shadow: 0 0 10px rgba(21, 255, 0, 0.4);
}

.build-list-item-name {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: -4px -4px 6px #000, 4px -4px 6px #000, -4px 4px 6px #000, 4px 4px 6px #000;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.build-list-item-meta {
    color: #afafaf;
    font-size: 11px;
    text-shadow: -4px -4px 6px #000, 4px -4px 6px #000, -4px 4px 6px #000, 4px 4px 6px #000;
}

.build-icon {
    font-size: 12px;
}

.build-icon.locked {
    color: #ff6b6b;
}

.build-icon.shared {
    color: #4CAF50;
}

/* Right Panel - Summary */
.build-manager-right {
    width: 55%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.6);
}

.build-summary-header {
    padding: 12px 15px;
    color: #ccc;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.build-summary-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.build-summary {
    color: #ccc;
    font-size: 13px;
    line-height: 1.6;
}

.build-summary-placeholder {
    color: #666;
    text-align: center;
    padding: 60px 20px;
    font-style: italic;
}

.build-summary-placeholder .summary-hint {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: #555;
}

/* Summary Sections */
.summary-section {
    margin-bottom: 15px;
}

.summary-section-title {
    color: #ffd700;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    text-shadow: -2px -2px 3px #000, 2px -2px 3px #000, -2px 2px 3px #000, 2px 2px 3px #000;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.summary-label {
    color: #fff;
    text-shadow: -2px -2px 3px #000, 2px -2px 3px #000, -2px 2px 3px #000, 2px 2px 3px #000;
}

.summary-value {
    color: #fff;
    text-shadow: -2px -2px 3px #000, 2px -2px 3px #000, -2px 2px 3px #000, 2px 2px 3px #000;
}

.summary-value.empty {
    color: #555;
    text-shadow: -2px -2px 3px #000, 2px -2px 3px #000, -2px 2px 3px #000, 2px 2px 3px #000;
    font-style: italic;
}

/* Footer */
.build-manager-footer {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    background: #2a2a2a;
    border-radius: 0 0 8px 8px;
    gap: 10px;
}

.footer-spacer {
    flex: 1;
}

.build-manager-btn {
    padding: 10px 20px;
    border: 1px solid;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.build-manager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-cancel {
    background: #00000050;
    border-color: #666;
    color: #999;
}

.btn-cancel:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: #888;
    color: #ccc;
}

.btn-delete {
    background: #00000050;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.btn-delete:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.2);
}

.btn-action {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    border-color: #ffd700;
    color: #000;
    min-width: 100px;
}

.btn-action:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffe44d 0%, #ffbb33 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.btn-action:disabled {
    background: #555;
    border-color: #444;
    color: #888;
}

/* Scrollbar Styling */
.build-list-container::-webkit-scrollbar,
.build-summary-container::-webkit-scrollbar {
    width: 8px;
}

.build-list-container::-webkit-scrollbar-track,
.build-summary-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.build-list-container::-webkit-scrollbar-thumb,
.build-summary-container::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.build-list-container::-webkit-scrollbar-thumb:hover,
.build-summary-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* ===== COMPARISON VIEW ===== */

.build-comparison {
    display: flex;
    height: 100%;
    gap: 0;
}

.comparison-side {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.comparison-side.current {
    border-right: 1px solid rgba(255, 215, 0, 0.2);
}

.comparison-labels {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    top: 50px;
    z-index: 1;
    pointer-events: none;
}

.comparison-label {
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 3px;
    margin-bottom: 8px;
}

.comparison-side .summary-section-title {
    font-size: 11px;
}

.comparison-side .summary-row {
    font-size: 12px;
    padding: 2px 0;
}

.build-summary-container.comparison-mode {
    position: relative;
}

.build-summary-container.comparison-mode .build-summary {
    padding: 0;
}

/* Tier-locked builds in Build Manager modal */
.build-list-item.tier-locked {
    opacity: 0.5;
    filter: grayscale(70%);
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

.build-list-item.tier-locked:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: inherit;
}

.build-list-item .build-icon.tier-lock {
    color: #f59e0b;
    margin-left: 4px;
}
