/* Premium Stylesheet for Antigravity CAD Viewer */

:root {
    --bg-primary: #0f172a;       /* Slate 900 */
    --bg-secondary: #1e293b;     /* Slate 800 */
    --bg-tertiary: #334155;      /* Slate 700 */
    --accent: #3b82f6;           /* Blue 500 */
    --accent-hover: #2563eb;     /* Blue 600 */
    --accent-glow: rgba(59, 130, 246, 0.35);
    
    --text-main: #f8fafc;        /* Slate 50 */
    --text-muted: #94a3b8;       /* Slate 400 */
    --text-dark: #64748b;        /* Slate 500 */
    
    --glass-bg: rgba(30, 41, 59, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* ==========================================
   VIEWER SECTION (LEFT)
   ========================================== */
.viewer-section {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #0c111d; /* Slightly darker behind the canvas */
}

/* Header style with Glassmorphism */
.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    border-radius: 10px;
    box-shadow: 0 0 12px var(--accent-glow);
    color: white;
    font-size: 1.1rem;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand h1 span {
    background: linear-gradient(to right, #60a5fa, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 400;
    margin-left: 2px;
}

.file-name-display {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toolbar Buttons */
.toolbar {
    display: flex;
    gap: 8px;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tool-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.tool-btn:active {
    transform: translateY(0);
}

/* Canvas viewport container */
.canvas-container {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
}

#dxfCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Splash/Drop screen */
.splash-screen {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: opacity 0.4s ease;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    max-width: 440px;
    padding: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px);
}

.splash-icon {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 24px;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-8%);
        animation-timing-function: cubic-bezier(0.8,0,1,1);
    }
    50% {
        transform: none;
        animation-timing-function: cubic-bezier(0,0,0.2,1);
    }
}

.splash-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.splash-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.splash-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.browse-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--accent);
    color: white;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.browse-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.quick-samples {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
}

.quick-samples span {
    color: var(--text-dark);
}

.sample-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
    transition: var(--transition-smooth);
}

.sample-btn:hover {
    color: #60a5fa;
}

/* Dragover drop zone effect */
.canvas-container.dragover::after {
    content: '';
    position: absolute;
    inset: 12px;
    border: 2px dashed var(--accent);
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.1);
    pointer-events: none;
    z-index: 6;
}

/* Bottom status bar */
.viewer-footer {
    display: flex;
    justify-content: space-between;
    height: 36px;
    padding: 0 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-muted);
    z-index: 10;
}

.footer-segment {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coords-display {
    font-family: monospace;
}

/* ==========================================
   SIDEBAR SECTION (RIGHT)
   ========================================== */
.sidebar-section {
    width: 360px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* Tabs list styling */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.15);
    padding: 4px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 0;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tab-btn i {
    font-size: 0.95rem;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--text-main);
    background: var(--bg-tertiary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Tab contents and panes */
.tab-pane {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-pane.active {
    display: flex;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
}

.pane-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.count-badge {
    background: var(--accent-glow);
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Layers list wrapper with custom scrollbar */
.layers-list-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 20px;
}

.layers-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.04);
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.layer-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.layer-name {
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.layer-toggle-btn:hover {
    color: var(--text-main);
}

.hidden-layer {
    opacity: 0.4;
}

/* Empty states */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.empty-icon {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.empty-state-text {
    color: var(--text-dark);
    font-size: 0.85rem;
    text-align: center;
    padding: 40px 0;
}

/* Inspector pane content */
.inspector-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
}

.inspector-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.inspector-group h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.inspector-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
}

.inspector-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.inspector-row:first-child {
    padding-top: 0;
}

.prop-label {
    color: var(--text-muted);
}

.prop-val {
    font-weight: 500;
    color: var(--text-main);
}

.code-font {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.type-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.highlight-val {
    font-weight: 600;
    color: #10b981; /* Green */
}

.highlight-text {
    font-style: italic;
    color: #eab308; /* Gold */
}

.sub-row {
    font-size: 0.8rem;
    padding-left: 8px;
}

/* Metadata pane content */
.metadata-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
}

.meta-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 16px;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.meta-value {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: monospace;
    word-break: break-all;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
