/* ============================================
   HUB PANEL STYLES
   ============================================ */

.hub-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    max-width: 90vw;
    max-height: 85vh;
    background: #1a1a2e;
    border: 2px solid #ffa500;
    border-radius: 8px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    user-select: none;
}

.hub-panel.open {
    display: flex;
}

/* Header */
.hub-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: #0d0d1a;
    border-bottom: 1px solid #333;
}

.hub-panel-tabs {
    display: flex;
}

.hub-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.hub-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.hub-tab.active {
    color: #ffa500;
    border-bottom-color: #ffa500;
}

.hub-close-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.hub-close-btn:hover {
    color: #ff4444;
}

/* Content */
.hub-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Tier Selector */
.hub-tier-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}

.hub-tier-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #252540;
    border: 2px solid #444;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.hub-tier-btn:hover:not(.locked) {
    border-color: #ffa500;
    color: #fff;
}

.hub-tier-btn.selected {
    background: #ffa500;
    border-color: #ffa500;
    color: #000;
}

.hub-tier-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.hub-tier-btn.complete .tier-number {
    color: #4ade80;
}

.hub-tier-btn .tier-label {
    font-size: 11px;
    text-transform: uppercase;
}

.hub-tier-btn .tier-number {
    font-size: 14px;
    font-weight: bold;
}

.hub-tier-btn .tier-check {
    margin-left: 2px;
    color: #4ade80;
    font-size: 12px;
}

.hub-tier-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.hub-tier-cheat-btn {
    padding: 6px 8px;
    background: #8b4513;
    border: none;
    border-radius: 4px;
    color: #ffd700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.hub-tier-cheat-btn:hover {
    background: #a0522d;
    color: #fff;
}

/* Select Tab Container - Side by Side Layout */
.hub-select-container {
    display: flex;
    gap: 15px;
    height: calc(85vh - 150px);
    max-height: 400px;
}

.hub-milestones-list {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.hub-details-side {
    flex: 1;
    min-width: 0;
}

.hub-details-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 14px;
}

.hub-milestone-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #252540;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.hub-milestone-card:hover {
    border-color: #ffa500;
}

.hub-milestone-card.selected {
    border-color: #ffa500;
    background: #2a2a50;
}

.hub-milestone-card.completed {
    opacity: 0.6;
    border-color: #4ade80;
}

.hub-milestone-card.active {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.milestone-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    border-radius: 4px;
    flex-shrink: 0;
}

.milestone-info {
    flex: 1;
    min-width: 0;
}

.milestone-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.milestone-status {
    font-size: 14px;
    flex-shrink: 0;
}

.status-complete {
    color: #4ade80;
}

.status-active {
    color: #ffd700;
}

/* Details Panel */
.hub-details-panel {
    padding: 15px;
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 6px;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}

.hub-details-panel h3 {
    margin: 0 0 12px 0;
    color: #ffa500;
    font-size: 16px;
}

.hub-details-panel h4 {
    margin: 12px 0 8px 0;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
}

.details-section:first-of-type h4 {
    margin-top: 0;
}

.cost-items, .reward-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cost-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #252540;
    border-radius: 4px;
    font-size: 12px;
}

.cost-item.have {
    border-left: 3px solid #4ade80;
}

.cost-item.need {
    border-left: 3px solid #ef4444;
}

.cost-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cost-icon .item-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.cost-amount {
    color: #888;
    font-size: 12px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #252540;
    border-radius: 4px;
    font-size: 12px;
    color: #aaa;
}

.reward-icon {
    font-size: 14px;
}

.hub-select-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: #ffa500;
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.hub-select-btn:hover {
    background: #ffb833;
}

/* Milestone status message */
.hub-milestone-status-msg {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.hub-milestone-status-msg.completed {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border: 1px solid #4ade80;
}

.hub-milestone-status-msg.active {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid #ffd700;
}

.hub-view-active-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background: #333;
    border: 1px solid #ffd700;
    border-radius: 6px;
    color: #ffd700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.hub-view-active-btn:hover {
    background: rgba(255, 215, 0, 0.2);
}

/* No Active Milestone */
.hub-no-active {
    text-align: center;
    padding: 60px 20px;
}

.no-active-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.no-active-text {
    font-size: 20px;
    color: #fff;
    margin-bottom: 10px;
}

.no-active-hint {
    color: #666;
    font-size: 14px;
}

/* Active Milestone */
.hub-active-milestone {
    padding: 10px;
}

.active-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.active-title {
    font-size: 24px;
    font-weight: bold;
    color: #ffa500;
}

.active-status {
    font-size: 14px;
    color: #888;
}

.active-requirements h4,
.active-rewards h4 {
    margin: 0 0 15px 0;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
}

.requirement-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.requirement-hint {
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
    text-align: center;
}

.requirement-slot {
    background: #252540;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.requirement-slot:not(.complete):hover {
    border-color: #ffa500;
    background: #2a2a4a;
}

.requirement-slot.complete {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    cursor: default;
}

.slot-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.slot-icon .item-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.slot-name {
    font-size: 14px;
    color: #fff;
    margin-bottom: 5px;
}

.slot-progress {
    font-size: 20px;
    font-weight: bold;
    color: #ffa500;
    margin-bottom: 10px;
}

.requirement-slot.complete .slot-progress {
    color: #4ade80;
}

.slot-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 8px;
}

.slot-deposit, .slot-withdraw {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.slot-deposit {
    background: #4ade80;
    color: #000;
}

.slot-deposit:hover:not(:disabled) {
    background: #6be898;
}

.slot-withdraw {
    background: #ef4444;
    color: #fff;
}

.slot-withdraw:hover:not(:disabled) {
    background: #f87171;
}

.slot-deposit:disabled, .slot-withdraw:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slot-inventory {
    font-size: 11px;
    color: #666;
}

.active-actions {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    padding: 20px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.hub-complete-btn {
    flex: 1;
    padding: 15px;
    background: #4ade80;
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.hub-complete-btn:hover {
    background: #6be898;
}

.hub-cancel-btn {
    padding: 15px 30px;
    background: #333;
    border: none;
    border-radius: 6px;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.hub-cancel-btn:hover {
    background: #444;
    color: #fff;
}

.hub-cheat-btn {
    padding: 15px 30px;
    background: #8b4513;
    border: none;
    border-radius: 6px;
    color: #ffd700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.hub-cheat-btn:hover {
    background: #a0522d;
    color: #fff;
}

.active-rewards {
    margin-top: 20px;
}

/* Loading/Empty States */
.hub-loading, .hub-empty, .hub-error {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Active tab container with inventory */
.hub-active-container {
    display: flex;
    gap: 20px;
}

.hub-active-milestone {
    flex: 1;
}

.hub-inventory-side {
    width: 280px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 15px;
}

.hub-inventory-side h4 {
    margin: 0 0 5px 0;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
}

.hub-inventory-hint {
    font-size: 10px;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.hub-inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-height: 350px;
    overflow-y: auto;
}

/* ============================================
   POWER TAB STYLES
   ============================================ */

.hub-power-container {
    display: flex;
    gap: 20px;
    height: 100%;
}

.hub-power-main {
    flex: 1;
}

.hub-power-main h3 {
    margin: 0 0 8px 0;
    color: #ffa500;
    font-size: 18px;
}

.hub-power-desc {
    color: #888;
    font-size: 12px;
    margin: 0 0 15px 0;
}

.hub-power-status-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #252540;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.hub-power-fuel-slot {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hub-power-fuel-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #1a1a2e;
    border: 2px solid #444;
    border-radius: 6px;
    padding: 4px;
}

.hub-power-fuel-empty {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    border: 2px dashed #444;
    border-radius: 6px;
    color: #666;
    font-size: 10px;
    text-align: center;
}

.hub-power-fuel-placeholder {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    border: 2px solid #ffa500;
    border-radius: 6px;
    color: #ffa500;
    font-size: 24px;
    font-weight: bold;
}

.hub-power-fuel-bar {
    width: 100%;
    height: 8px;
    background: #1a1a2e;
    border-radius: 4px;
    overflow: hidden;
}

.hub-power-fuel-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffa500, #ff6600);
    transition: width 0.1s;
}

.hub-power-stats {
    flex: 1;
}

.hub-power-stat {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #333;
}

.hub-power-stat:last-child {
    border-bottom: none;
}

.hub-power-stat .stat-label {
    color: #888;
    font-size: 12px;
}

.hub-power-stat .stat-value {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.hub-power-stat .stat-value.working {
    color: #4ade80;
}

.hub-power-stat .stat-value.ready {
    color: #ffa500;
}

.hub-power-fuel-list {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px;
}

.hub-power-fuel-list h4 {
    margin: 0 0 8px 0;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
}

.hub-power-no-fuel {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.hub-power-fuel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #ccc;
}

.hub-power-item-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.hub-power-inventory {
    width: 280px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 15px;
}

.hub-power-inventory h4 {
    margin: 0 0 5px 0;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
}

.hub-power-hint {
    font-size: 10px;
    color: #666;
    margin: 0 0 10px 0;
    font-style: italic;
}

.hub-power-inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    max-height: 350px;
    overflow-y: auto;
}
