/* File Size Visualizer — style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #0d0d18;
    --bg2: #131322;
    --bg3: #191930;
    --bg4: #1f1f38;
    --border: #23233a;
    --border2: rgba(255, 255, 255, 0.05);
    --text: #d8d8f0;
    --text2: #5a5a90;
    --text3: #30305a;
    --primary: #818cf8;
    --primary2: #a5b4fc;
    --primary3: #4f46e5;
    --radius: 12px;
    --t: all 0.2s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 55% 40% at 8% 5%, rgba(129, 140, 248, 0.1), transparent), radial-gradient(ellipse 40% 25% at 92% 88%, rgba(165, 180, 252, 0.06), transparent);
    z-index: 0;
}

/* Header */
header {
    background: rgba(13, 13, 24, 0.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.hdr {
    max-width: 1300px;
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.3);
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
}

h1.brand-title {
    display: inline;
}

.brand-sub {
    font-size: 10px;
    color: var(--text3);
}

.brand-sub code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(129, 140, 248, 0.1);
    padding: 0 3px;
    border-radius: 3px;
}

.hdr-actions {
    display: flex;
    gap: 6px;
}

/* Layout */
.app-layout {
    flex: 1;
    max-width: 1300px;
    margin: 0 auto;
    padding: 14px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Input panel */
.input-panel {
    background: rgba(19, 19, 34, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.input-top {
    display: flex;
    flex-direction: column;
}

.input-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border2);
    flex-wrap: wrap;
}

.inp-textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    padding: 12px;
    outline: none;
    resize: vertical;
    min-height: 130px;
}

.inp-textarea::placeholder {
    color: var(--text3);
}

/* Treemap panel */
.treemap-panel {
    background: rgba(19, 19, 34, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 550px;
}

.treemap-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border2);
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tb-label {
    font-size: 10px;
    color: var(--text3);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow: hidden;
}

.bc-seg {
    font-size: 12px;
    cursor: pointer;
    color: var(--text2);
    transition: var(--t);
}

.bc-seg:hover {
    color: var(--primary2);
}

.bc-sep {
    color: var(--text3);
    font-size: 12px;
}

.bc-current {
    color: var(--text);
    font-weight: 600;
}

.treemap-canvas {
    flex: 1;
    cursor: pointer;
    display: block;
    min-height: 480px;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: rgba(19, 19, 34, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 12px;
    font-size: 12px;
    pointer-events: none;
    z-index: 99;
    max-width: 240px;
}

.tt-name {
    font-weight: 700;
    margin-bottom: 3px;
}

.tt-size {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary2);
}

.tt-type {
    color: var(--text3);
    font-size: 10px;
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 12px;
    border-top: 1px solid var(--border2);
}

.leg-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text2);
}

.leg-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* Select */
.sel {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    padding: 4px 8px;
    outline: none;
    cursor: pointer;
}

.sel-sm {
    padding: 3px 6px;
    font-size: 11px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
}

.btn:hover {
    border-color: var(--primary);
    color: var(--primary2);
}

.btn-sm {
    padding: 3px 9px;
    font-size: 11px;
    border-radius: 6px;
}

.btn-primary {
    background: var(--primary3);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
    padding: 6px 16px;
    font-size: 12px;
}

.btn-primary:hover {
    opacity: 0.9;
}

.toast-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: var(--bg2);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text);
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.22s ease;
}

.toast.show {
    transform: none;
    opacity: 1;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px
}

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

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