/* PURE FLAT DESIGN - MATCHING CARGO SITE (TOM EXATO) */
:root {
    --bg-workspace: transparent; 
    --bg-panel: #b3b3b3;       
    --bg-section: #bebebe;     
    --bg-input: #f4f4f4;       
    --bg-input-hover: #ffffff; 
    --text-main: #111111;
    --text-muted: #444444;
    --accent: #000000;
    --kf-active: #000000;
    --kf-animating: #666666;
    --radius: 8px;             
}

* { box-sizing: border-box; }

body { margin: 0; overflow: hidden; font-family: 'DM Sans', sans-serif; color: var(--text-main); font-size: 11px; background: var(--bg-workspace); user-select: none; transition: background 0.3s; cursor: default; }
body.loading-font, body.loading-font * { cursor: wait !important; }

#artboard-wrapper { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: opacity 0.3s; }
body.loading-font #artboard-wrapper { opacity: 0.5; }

canvas { display: block; border-radius: var(--radius); background: transparent; transition: width 0.3s ease, height 0.3s ease; border: none; box-shadow: none !important; }

.bg-grid { background-image: linear-gradient(45deg, #b5b5b5 25%, transparent 25%), linear-gradient(-45deg, #b5b5b5 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #b5b5b5 75%), linear-gradient(-45deg, transparent 75%, #b5b5b5 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }

::-webkit-scrollbar { width: 4px; height: 4px; } ::-webkit-scrollbar-thumb { background: #aaa; border-radius: 4px; }

/* Splash Screen */
#splash-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-panel); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.4s ease; }
.splash-logo-wrap { display: flex; align-items: center; opacity: 0; transform: translateY(10px); animation: reveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.2s; }
.splash-logo { font-size: 32px; font-weight: 800; color: var(--text-main); line-height: 1; letter-spacing: -1px; display: flex; align-items: center;}
.splash-status { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-top: 24px; opacity: 0; animation: reveal 0.8s ease forwards 0.4s; text-transform: uppercase; letter-spacing: 1px;}

.beta-tag { background: #b8b8b8; color: #333333; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; margin-left: 8px; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0.5px; height: 14px;}

/* Overlay Loading de Fonte */
#font-loader-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(200, 200, 200, 0.5); backdrop-filter: blur(4px); z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--radius); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--text-muted); border-top-color: var(--text-main); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 12px; }
#font-loader-text { font-size: 11px; font-weight: 700; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.5px;}

@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Painéis Flat */
.panel { position: absolute; background: var(--bg-panel); z-index: 10; display: flex; border-radius: var(--radius); border: none; box-shadow: none !important; }
.panel-left { top: 16px; left: 16px; width: 280px; height: calc(100vh - 32px); flex-direction: column; overflow-y: auto; }
.panel-right { top: 16px; right: 16px; width: 280px; height: calc(100vh - 32px); flex-direction: column; overflow-y: auto; }
.panel-top { top: 16px; left: 50%; transform: translateX(-50%); height: auto; padding: 10px 16px; flex-direction: row; align-items: center; justify-content: center; }
.panel-bottom { bottom: 16px; left: 50%; transform: translateX(-50%); padding: 14px 20px; flex-direction: column; width: calc(100vw - 640px); max-width: 700px; max-height: 220px; }

.header-logo-ui { padding: 16px; font-size: 14px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-main); background: var(--bg-section); flex-shrink: 0; border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; justify-content: space-between; border: none;}
.header-logo-ui div { display: flex; align-items: center;}

.section { padding: 16px; background: var(--bg-panel); flex-shrink: 0; border: none; }
.section:nth-child(even) { background: var(--bg-section); }

.section-title { font-size: 10px; color: var(--text-muted); font-weight: 700; letter-spacing: 0.5px; margin-bottom: 12px; text-transform: uppercase;}

.control-row { margin-bottom: 12px; width: 100%; position: relative; } .control-row:last-child { margin-bottom: 0; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.label { font-weight: 600; font-size: 11px; color: var(--text-main); }

.slider-group { display: flex; align-items: center; gap: 8px; width: 100%; }
input[type="range"] { -webkit-appearance: none; flex-grow: 1; height: 4px; background: var(--bg-input); cursor: pointer; border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; height: 12px; width: 12px; background: var(--text-main); cursor: pointer; border-radius: 50%; }

input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

input[type="number"], input[type="text"], textarea { width: 100%; padding: 8px 10px; background: var(--bg-input); color: var(--text-main); border: none; border-radius: var(--radius); font-family: inherit; font-size: 11px; font-weight: 500; outline: none; transition: background 0.2s; }
input[type="number"]:focus, input[type="text"]:focus, textarea:focus { background: var(--bg-input-hover); }
input[type="number"] { width: 50px; text-align: center; }
textarea { resize: vertical; min-height: 50px; max-width: 100%; min-width: 100%; }

.input-with-unit { position: relative; display: flex; align-items: center; }
.input-with-unit input { padding-right: 16px; width: 48px; }
.input-with-unit span { position: absolute; right: 6px; font-size: 10px; font-weight: 600; color: var(--text-muted); pointer-events: none; }

/* Estilização agressiva para limpar dropdowns nativos e customizados */
select { appearance: none; -webkit-appearance: none; width: 100%; padding: 8px 24px 8px 10px; background: var(--bg-input); color: var(--text-main); border: none; border-radius: var(--radius); font-family: inherit; font-size: 11px; font-weight: 500; outline: none; cursor: pointer; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2210%22%20height%3D%226%22%20viewBox%3D%220%200%2010%206%22%3E%3Cpath%20fill%3D%22%23111111%22%20d%3D%22M5%206L0%200h10z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 8px 5px;}
select:hover { background-color: var(--bg-input-hover); }

select.hidden-native { display: none !important; }
.custom-select-wrapper { position: relative; width: 100%; font-size: 11px; font-weight: 500; }
.custom-select-trigger { padding: 8px 24px 8px 10px; background: var(--bg-input); border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; transition: 0.2s; position: relative; border: none; }
.custom-select-trigger:hover { background: var(--bg-input-hover); }
.custom-select-trigger::after { content: ''; position: absolute; right: 10px; top: 50%; width: 5px; height: 5px; border-right: 1.5px solid var(--text-main); border-bottom: 1.5px solid var(--text-main); transform: translateY(-60%) rotate(45deg); transition: transform 0.2s; }
.custom-select-wrapper.open .custom-select-trigger::after { transform: translateY(-20%) rotate(225deg); }

.custom-select-options { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-panel); border-radius: var(--radius); margin-top: 4px; z-index: 100; max-height: 200px; overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: 0.2s ease; border: none; box-shadow: none !important; outline: 1px solid var(--bg-input-hover); }
.custom-select-wrapper.open .custom-select-options { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-select-wrapper.open-up .custom-select-options { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 4px; transform: translateY(4px); }
.custom-select-wrapper.open.open-up .custom-select-options { transform: translateY(0); }

.custom-option { padding: 8px 10px; cursor: pointer; transition: 0.1s; }
.custom-option:hover { background: var(--bg-input); }
.custom-option.selected { font-weight: 700; background: var(--bg-section); }
.custom-optgroup { padding: 6px 10px 2px 10px; font-size: 9px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; pointer-events: none; }

.color-wrap { display: flex; align-items: center; gap: 4px; position: relative; }
.custom-swatch { width: 22px; height: 22px; border-radius: var(--radius); background: var(--bg-input); transition: 0.2s; position: relative; overflow: hidden; border: none; }
.custom-swatch:hover { transform: scale(1.05); }
.custom-swatch input[type="color"] { position: absolute; top: -10px; left: -10px; width: 50px; height: 50px; opacity: 0; cursor: pointer; }

.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text-main); }
.checkbox-label input[type="checkbox"] { accent-color: var(--text-main); width: 12px; height: 12px; cursor: pointer; border: none; }

details { background: var(--bg-section); border-radius: var(--radius); margin-bottom: 8px; border: none; }
summary { padding: 10px 12px; font-weight: 600; font-size: 11px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; border: none;}
summary::-webkit-details-marker { display: none; } summary:after { content: '+'; color: var(--text-muted); font-size: 14px; font-weight: 400;}
details[open] summary:after { content: '−'; } 
.details-content { padding: 12px; }

.btn-primary { background: var(--text-main); color: #fff; border: none; padding: 8px 14px; cursor: pointer; font-weight: 600; border-radius: var(--radius); transition: 0.2s; font-family: inherit; font-size: 11px; box-shadow: none !important;}
.btn-primary:hover { opacity: 0.8; }
.btn-icon { background: var(--bg-input); border: none; font-weight: 600; cursor: pointer; color: var(--text-main); display: flex; align-items: center; justify-content: center; border-radius: var(--radius); transition: 0.2s; box-shadow: none !important;}
.btn-icon:hover { background: var(--bg-input-hover); }

.dock-row { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }

.kf-btn { font-size: 14px; color: rgba(0,0,0,0.1); cursor: pointer; transition: 0.15s; margin-left: 6px; line-height: 1; }
.kf-btn:hover { color: var(--text-main); }
.kf-active { color: var(--kf-active); }
.kf-animating { color: var(--kf-animating); }

.tl-controls { display: flex; width: 100%; align-items: center; gap: 10px; margin-bottom: 10px; }
.tl-track-area { flex-grow: 1; position: relative; height: 24px; background: var(--bg-section); border-radius: var(--radius); cursor: pointer; overflow: hidden; border: none; }
.tl-playhead { position: absolute; top: 0; left: 0%; width: 2px; height: 100%; background: #ff3b30; z-index: 5; pointer-events: none; }
.tl-playhead::after { content: ''; position: absolute; top: 0; left: -3px; width: 8px; height: 6px; background: #ff3b30; border-radius: 0 0 2px 2px; }

.tl-layers-container { width: 100%; overflow-y: auto; max-height: 120px; display: flex; flex-direction: column; gap: 4px; padding-right: 4px;}
.tl-layer { display: flex; width: 100%; align-items: center; height: 28px; background: var(--bg-section); border-radius: var(--radius); position: relative; border: none; }
.tl-layer-name { width: 140px; font-size: 9px; font-weight: 600; padding-left: 8px; color: var(--text-main); flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding-right: 4px; text-transform: uppercase;}

.layer-ease-select { background: transparent; border: none; font-size: 9px; padding: 0 12px 0 2px; height: 14px; color: var(--text-muted); margin-left: auto; margin-right: 4px; background-position: right 2px center; background-size: 6px 4px; width: auto;}
.layer-ease-select:hover { color: var(--text-main); background-color: var(--bg-input);}

.layer-del-btn { background: none; border: none; color: #ff3b30; cursor: pointer; font-size: 14px; padding: 0 2px; opacity: 0.4; transition: 0.2s; line-height: 1;}
.layer-del-btn:hover { opacity: 1; }
.tl-layer-track { flex-grow: 1; height: 100%; position: relative; }
.tl-kf-diamond { position: absolute; top: 50%; transform: translate(-50%, -50%) rotate(45deg); width: 8px; height: 8px; cursor: grab; z-index: 2; transition: transform 0.1s; }
.tl-kf-diamond:hover { background: #ff3b30; }
.tl-kf-diamond:active { cursor: grabbing; }
.kf-start { background: var(--text-main); }
.kf-end { background: transparent; border: 2px solid var(--text-main); box-sizing: border-box; }
.kf-mid { background: #888; width: 6px; height: 6px; }

/* MODAIS E POPUPS Flat */
#modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.2); backdrop-filter: blur(4px); z-index: 99999; display: none; align-items: center; justify-content: center; }
.modal-box { background: var(--bg-panel); width: 280px; padding: 20px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 16px; border: none; box-shadow: none !important; }
.modal-title { font-size: 14px; font-weight: 700; color: var(--text-main); margin: 0; padding-bottom: 10px;}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn-outline { background: var(--bg-input); border: none; color: var(--text-main); padding: 8px 14px; border-radius: var(--radius); font-size: 11px; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: inherit; box-shadow: none !important;}
.btn-outline:hover { background: var(--bg-input-hover); }

#kf-editor { display: none; position: fixed; z-index: 999999; background: var(--bg-panel); padding: 8px; border-radius: var(--radius); flex-direction: column; gap: 4px; border: none; box-shadow: none !important; }
#kf-editor-title { font-size: 9px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;}
#kf-edit-val { width: 55px; padding: 4px 6px; font-size: 11px; text-align: left; border: none; background: var(--bg-input); border-radius: var(--radius); color: var(--text-main);}