/**
 * Layout Styles - Main structure and positioning
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Disable selection globally for game UI */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    position: fixed;
    top: 0;
    left: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    touch-action: none;
}

/* Fixed UI wrappers (see FIXED_UI_GUIDE.md) */
#scale-wrapper {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    background: #0f0f0f;
}

#game-wrapper {
    width: 1400px;  /* logical resolution */
    height: 800px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    will-change: transform;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Left Panel - World Management */
.left-panel {
    width: 280px;
    background: #1a1a1a;
    border-right: 2px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-section {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.panel-section h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #3498db;
}

.panel-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #e0e0e0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0f0f0f;
    overflow: hidden;
}

/* Top Toolbar */
.top-toolbar {
    background: #1a1a1a;
    border-bottom: 2px solid #2a2a2a;
    padding: 12px 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 60px;
}

.toolbar-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a0a0a;
    overflow: hidden;
}

#gameCanvas {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    cursor: crosshair;
    display: block;
}

/* Right Panel - Catalog & Properties */
.right-panel {
    width: 320px;
    background: #1a1a1a;
    border-left: 2px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Scrollbar Styling */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track {
    background: #0f0f0f;
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loading-icon {
    width: 128px;
    height: 128px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #e0e0e0;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

