:root {
    --primary: #2ecc71;
    --secondary: #3498db;
    --bg: #0a0e14;
    --card: rgba(255, 255, 255, 0.05);
    --text: #e0e0e0;
    --accent: #f1c40f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(52, 152, 219, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(46, 204, 113, 0.05) 0%, transparent 40%);
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(46, 204, 113, 0.15);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
    border: 1px solid rgba(46, 204, 113, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.tab-btn {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(46, 204, 113, 0.05);
}

.main-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    height: 100%;
}

#map {
    height: 500px;
    border-radius: 20px;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    background: #000;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-family: inherit;
}

.btn {
    background: linear-gradient(135deg, var(--primary) 0%, #27ae60 100%);
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.results-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#scene-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.scene-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s;
}

.scene-card:hover { border-color: var(--secondary); }

.scene-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #000;
}

.scene-info { padding: 12px; }

.scene-title {
    font-size: 0.75rem;
    color: #eee;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analysis-viewport {
    position: relative;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

#resultImg {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.placeholder-text {
    color: #444;
    font-weight: 600;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.log-terminal {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #0f0;
    background: #000;
    padding: 15px;
    border-radius: 12px;
    height: 120px;
    overflow-y: auto;
    border: 1px solid #111;
}

#loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.upload-compact {
    padding: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
