/* Sphere Grid Viewer Styles */

.sphere-grid-viewer {
    position: relative;
    width: 100%;
    height: 70vh;
    background: #0a0a0a;
    border-radius: var(--ffx-radius-xl);
    border: 1px solid var(--ffx-border-secondary);
    overflow: hidden;
    margin-bottom: var(--ffx-spacing-xl);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* === VIEWPORT & CONTENT === */
.grid-viewport {
    width: 100%;
    height: 100%;
    cursor: grab;
}

.grid-viewport:active {
    cursor: grabbing;
}

.grid-content {
    position: relative;
    width: 3840px; /* Match high-res image width */
    height: 3840px;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
    background-image: url('https://static.wikia.nocookie.net/finalfantasy/images/1/1a/Zoomed-out-Standard-Sphere-Grid-FFX-HD.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    box-shadow: 0 0 100px rgba(0, 0, 0, 1);
}

/* === CONTROLS OVERLAY === */
.grid-controls {
    position: absolute;
    top: var(--ffx-spacing-lg);
    left: var(--ffx-spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--ffx-spacing-md);
    z-index: 10;
}

.control-group {
    display: flex;
    gap: 4px;
    background: var(--ffx-surface-glass);
    backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: var(--ffx-radius-lg);
    border: 1px solid var(--ffx-border-primary);
}

.control-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: white;
    border-radius: var(--ffx-radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.grid-select {
    background: transparent;
    border: none;
    color: white;
    padding: 0 10px;
    font-family: inherit;
    font-weight: 600;
    outline: none;
}

.grid-select option {
    background: #1a1a1a;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ffx-surface-glass);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: var(--ffx-radius-pill);
    border: 1px solid var(--ffx-border-primary);
    width: 300px;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

/* === NODE INFO PANEL === */
.node-info-panel {
    position: absolute;
    bottom: var(--ffx-spacing-lg);
    right: var(--ffx-spacing-lg);
    width: 280px;
    background: var(--ffx-surface-glass);
    backdrop-filter: blur(15px);
    border-radius: var(--ffx-radius-xl);
    border: 1px solid var(--ffx-border-secondary);
    padding: var(--ffx-spacing-lg);
    z-index: 10;
    box-shadow: var(--ffx-shadow-lg);
    animation: ffxFadeIn 0.3s ease-out;
}

.panel-placeholder {
    text-align: center;
    color: var(--ffx-text-muted);
}

.panel-placeholder i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

.node-name {
    font-size: 1.25rem;
    color: var(--ffx-gold);
    margin: 0 0 8px 0;
}

.node-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 12px;
}

.node-desc {
    font-size: 0.875rem;
    color: var(--ffx-text-secondary);
    line-height: 1.5;
    margin-bottom: 15px;
}

/* === NODES ON GRID === */
.grid-node {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 5;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.grid-node:hover {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 10;
    box-shadow: 0 0 20px white;
}

/* Node Types */
.node-hp { background: #ef4444; }
.node-mp { background: #3b82f6; }
.node-str { background: #f97316; }
.node-def { background: #10b981; }
.node-mag { background: #8b5cf6; }
.node-mdef { background: #ec4899; }
.node-agi { background: #facc15; }
.node-eva { background: #22d3ee; }
.node-acc { background: #fb923c; }
.node-luk { background: #ffffff; }
.node-ability { background: #fbbf24; border-radius: 4px; width: 24px; height: 24px; }
.node-lock { background: #334155; border-color: #94a3b8; }

/* === GRID LEGEND === */
.grid-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ffx-spacing-lg);
    justify-content: center;
    background: var(--ffx-surface-primary);
    padding: var(--ffx-spacing-lg);
    border-radius: var(--ffx-radius-lg);
    border: 1px solid var(--ffx-border-primary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--ffx-text-secondary);
}

.node-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.stat-hp { background: #ef4444; }
.stat-mp { background: #3b82f6; }
.stat-str { background: #f97316; }
.stat-def { background: #10b981; }
.ability { background: #fbbf24; border-radius: 2px; }
.lock { background: #334155; }

/* === LOADING === */
.grid-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.hidden { display: none; }
