/* theme.css — clean, flat dark UI with rounded cards. Themes only change a few variables. */
:root, html[data-theme="frost"] { --bg:#070a10; --panel:#0e1420; --panel-2:#16203a; --border:#243049; --accent:#6aa5ff; --text:#eaf1ff; --muted:#8a97b3; --pop:#111a2c; }
html[data-theme="midnight"] { --bg:#0b0d14; --panel:#131621; --panel-2:#1b1f2e; --border:#252a3c; --accent:#6c9bff; }
html[data-theme="crimson"]  { --bg:#0f0809; --panel:#1a1012; --panel-2:#25171a; --border:#3a2328; --accent:#e5384f; --text:#f5ecec; --muted:#a58e92; --pop:#201316; }
:root { --ok:#54c27f; --bad:#ec6b72; --r:12px; --r-sm:8px;
  --accent-dim:color-mix(in srgb, var(--accent) 18%, transparent); --pop:#1b1d22; }
html, body, .editor { background: var(--bg) !important; }
body { font-size: 13px; }
.i { width: 16px; height: 16px; flex: none; }

/* bars */
.topbar, .ed-top { background: var(--panel) !important; border-bottom: 1px solid var(--border) !important; }
.topbar { padding: 0 16px; } .ed-top { padding: 6px 12px; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; } .brand img { height: 26px; width: auto; display: block; }
.logo-mark { width: 26px; height: 26px; object-fit: contain; flex: none; margin-right: 2px; }
.sep { background: var(--border); height: 18px; }

/* buttons & inputs */
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); padding: 6px 11px; transition: background .12s, border-color .12s; }
button:hover:not(:disabled) { background: color-mix(in srgb, var(--panel-2) 70%, #fff 8%); border-color: #3a3e48; }
button.primary, button.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { filter: brightness(1.1); }
.ed-top select, .props select, .props input[type=number], .props textarea, .fontbtn, .fontlist input, .gf-table input, .ed-name:hover, .ed-name:focus {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); }
.props input:focus, .props select:focus, .props textarea:focus, .fontlist input:focus { outline: 0; border-color: var(--accent); }
.seg { border-radius: var(--r-sm); border-color: var(--border); background: var(--bg); padding: 2px; gap: 2px; }
.seg button { border: 0 !important; border-radius: 6px; background: transparent; padding: 4px 10px; }
.seg button.active { background: var(--panel-2); box-shadow: none; color: var(--text); }
#edGapFix.active { background: var(--accent-dim); border-color: var(--accent); }
input[type=color] { border-radius: var(--r-sm); cursor: pointer; }
input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }

/* cards */
.ed-main { padding: 8px; }
.ed-left, .ed-right { background: var(--panel) !important; border: 1px solid var(--border) !important; border-radius: 14px; }
.ed-center { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ed-viewport { background: #111216 !important; }
.statusbar { background: var(--panel) !important; border-top: 1px solid var(--border) !important; }
.ed-resizer { background: transparent !important; }
.ed-resizer::after { content: ""; position: absolute; top: 50%; left: 1px; width: 3px; height: 38px; margin-top: -19px; border-radius: 3px; background: transparent; transition: background .12s; }
.ed-resizer:hover::after, .ed-resizer.dragging::after { background: var(--accent); }
.panel-title { background: none !important; color: var(--muted); font-size: 11px; letter-spacing: .7px; padding: 10px 14px; border-top: 1px solid var(--border); }
.ed-left .panel-title:first-child, .ed-right .panel-title:first-child { border-top: 0; }
.badge { background: var(--panel-2); border-radius: 10px; padding: 1px 8px; }

/* tools */
.tools { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 12px; }
.tool { flex-direction: column; justify-content: center; gap: 5px; padding: 10px 4px 8px; font-size: 11px; color: var(--muted); border-radius: 10px; }
.tool .i { width: 20px; height: 20px; }
.tool:hover:not(:disabled) { color: var(--text); }
.tool.active { background: var(--accent-dim) !important; border-color: transparent !important; color: var(--accent); box-shadow: none; }
.decal, .upload { border-radius: var(--r-sm); } .decals { gap: 8px; }

/* layers */
.layers { padding: 6px; } .layer { border-radius: 10px; padding: 4px 6px; gap: 4px; }
.layer.selected { background: var(--accent-dim); border-color: transparent; }
.ico { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; padding: 0 !important; border: 0 !important; background: none !important; border-radius: 6px; color: var(--muted); }
.ico .i { width: 14px; height: 14px; } .ico:hover:not(:disabled) { color: var(--text); background: var(--panel-2) !important; }
.ico.on { color: var(--accent); } .ltype { border-radius: 4px; }
.small-btn { padding: 3px 9px !important; border-radius: 7px; font-size: 11px; }

/* popups */
.menu-list, .fontlist, .gf-card, .shortcuts, .toast { background: var(--pop) !important; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.5); }
.menu-list button { border-radius: 8px; }
.gf-modal { background: rgba(0,0,0,.55); }
.fontitem { border-radius: 0; } .fontitem:hover:not(:disabled) { background: var(--accent-dim); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2f333b; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* status bar */
.ed-status { display: flex; align-items: center; gap: 16px; min-height: 32px; padding: 4px 12px; white-space: nowrap; overflow: hidden; }
.ed-status > span { flex: none; } .ed-status > #edMessage { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ed-status .small-btn { flex: none; margin-left: auto; }

/* shortcuts, theme control, toasts */
.shortcuts { position: fixed; left: 20px; bottom: 48px; z-index: 70; width: min(520px, 94vw); max-height: 70vh; overflow: auto; padding: 14px 16px; font-size: 12px; }
.shortcuts[hidden] { display: none; } .shortcuts h4 { margin: 0 0 8px; font-size: 13px; }
.shortcuts .sc { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; } .shortcuts .sc div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); } .shortcuts .sc b { color: var(--text); font-weight: 500; }
.themebox { display: inline-flex; align-items: center; gap: 6px; } .themebox select { max-width: 112px; }
.themebox input[type=color] { width: 28px; height: 28px; padding: 2px; background: var(--bg); border: 1px solid var(--border); }
#toasts { position: fixed; right: 16px; bottom: 48px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(380px, 92vw); pointer-events: none; }
.toast { pointer-events: auto; position: relative; padding: 11px 32px 11px 14px; border-left: 4px solid var(--bad); font-size: 12px; animation: tin .16s ease-out; }
.toast.info { border-left-color: var(--accent); } .toast.ok { border-left-color: var(--ok); }
.toast b { display: block; margin-bottom: 2px; } .toast span { color: var(--muted); word-break: break-word; }
.toast .x { position: absolute; top: 6px; right: 6px; border: 0; background: none; padding: 2px 6px; color: var(--muted); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.fontbtn { justify-content: flex-start; }
.panel-title > span:last-child { display: inline-flex; align-items: center; gap: 6px; }

/* Frost (default): icy glass panels matching the Aorus website */
html[data-theme="frost"] .topbar, html[data-theme="frost"] .ed-top { background: linear-gradient(180deg, rgba(190,220,255,.07), rgba(190,220,255,.02)), var(--panel) !important; box-shadow: inset 0 1px 0 rgba(225,240,255,.12); }
html[data-theme="frost"] button:not(.primary) { box-shadow: inset 0 1px 0 rgba(225,240,255,.10); }
html[data-theme="frost"] button.primary { background: linear-gradient(180deg, rgba(170,205,255,.9), var(--accent)); border-color: rgba(200,225,255,.5); color: #06101f; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
