/* ========================================
   LAYOUT & STRUCTURE
   ======================================== */

#app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--color-bg-primary);
    z-index: 1;
}

/* GLOBAL SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

#app.is-maximized {
    border-radius: 0;
    border: none;
}

/* HEADER */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: 0 var(--spacing-md);
    background: rgba(10, 11, 14, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: 64px;
    width: 100%;
    flex-shrink: 0;
    -webkit-app-region: drag;
    z-index: 300;
    box-sizing: border-box;
}

.header-brand, .header-info, .header-actions {
    -webkit-app-region: no-drag;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.logo img {
    width: 100%;
    height: 100%;
    display: block;
}

.header-brand h1 {
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: white;
}

.version {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.15s var(--ease-out-expo), background 0.15s var(--ease-out-expo);
}

.version:hover {
    color: var(--color-accent);
    background: rgba(var(--color-accent-rgb), 0.08);
    border-color: rgba(var(--color-accent-rgb), 0.2);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
    flex: 1;
    justify-content: center;
}

.coords-display {
    font-family: var(--font-mono);
    font-size: 12px;
    display: flex;
    gap: 12px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.coord-label {
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
}

#coordX, #coordY {
    color: var(--color-accent);
    min-width: 44px;
    font-weight: 700;
}

.map-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

@media (max-width: 1280px) {
    .header-info {
        justify-content: flex-start;
    }
}

.divider-vertical {
    width: 1px;
    height: 24px;
    background-color: var(--color-border);
    margin: 0 var(--spacing-xs);
}

/* MAIN CONTENT LAYOUT */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    position: relative;
    /* Dot-grid on the whole workspace — eliminates flat strips from padding gaps */
    background-color: #080a0d;
    background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 28px 28px;
}

.main-view-column {
    position: absolute;
    inset: 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.tab-bar {
    position: relative;
    z-index: 110;
    flex: 0 0 auto;
    min-width: 0;
    padding: 12px 360px 0 96px;
}

/* TOOLBAR */
.toolbar {
    position: absolute;
    left: 24px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 10px;
    background: rgba(8, 10, 14, 0.64);
    backdrop-filter: blur(28px) saturate(175%);
    -webkit-backdrop-filter: blur(28px) saturate(175%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 18px 48px rgba(0,0,0,0.58);
    border-radius: 20px;
    width: 72px;
    align-items: center;
    height: fit-content;
    max-height: calc(100% - 48px);
    overflow-y: auto;
}

.tool-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.tool-group-label {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.tool-divider {
    width: 24px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
    flex-shrink: 0;
}

.tool-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: color 0.15s var(--ease-out-expo), background 0.15s var(--ease-out-expo), border-color 0.15s var(--ease-out-expo), transform 0.15s var(--ease-out-expo);
    position: relative;
}

.tool-btn svg,
.tool-btn .lucide {
    width: 18px;
    height: 18px;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.tool-btn:active {
    transform: scale(0.95);
}

.tool-btn.active {
    background: rgba(var(--color-accent-rgb), 0.15);
    border-color: rgba(var(--color-accent-rgb), 0.35);
    color: var(--color-accent);
    box-shadow: 0 0 16px rgba(var(--color-accent-rgb), 0.15);
}
