@import url("https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap");
:root {
  --primary-color: #2563eb;
  --header-bg: #1b2537;
  --bg-color: #f4f7f6; 
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-comic: 'Comic Neue', 'Chalkboard SE', 'Marker Felt', sans-serif; 
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-main); }
body { background-color: var(--bg-color); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; }

.govt-header { background: var(--header-bg); color: #ffffff; padding: 12px 30px; border-bottom: 3px solid var(--primary-color); width: 100%; position: fixed; top: 0; left: 0; z-index: 1000; height: 80px; }
.header-container { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand-logo { display: flex; align-items: center; gap: 14px; }
.brand-logo i { font-size: 32px; color: #38bdf8; }
.brand-logo h1 { font-size: 20px; font-weight: 700; color: #ffffff; }

.portal-layout { display: flex; width: 100%; margin-top: 80px; min-height: calc(100vh - 80px); }
.app-sidebar { width: 85px; background: var(--sidebar-bg); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; padding: 15px 0; gap: 12px; position: fixed; height: calc(100vh - 80px); top: 80px; left: 0; z-index: 100; overflow-y: auto; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 68px; height: 68px; border-radius: 12px; text-decoration: none; color: #64748b; font-size: 11px; font-weight: 600; gap: 6px; transition: 0.2s ease; text-align: center; }
.nav-item i { font-size: 20px; }
.nav-item:hover { background: #f8fafc; color: var(--primary-color); }
.nav-item.active { background: #eff6ff; color: var(--primary-color); }
.app-main { margin-left: 85px; flex: 1; padding: 35px; width: calc(100% - 85px); }

.dual-icon { position: relative; width: 66px; height: 62px; margin-bottom: 14px; }
.dual-icon .sq { position: absolute; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; }
.dual-icon .pos-tl { top: 0; left: 0; }
.dual-icon .pos-br { top: 22px; left: 26px; }
.dual-icon .light { background: #fecaca; color: #b91c1c; z-index: 1; }
.dual-icon .solid { background: #dc2626; color: #fff; z-index: 2; font-size: 12px; }

[hidden] { display: none !important; }
.tool-page { max-width: 1000px; margin: 0 auto; }
.tool-page.wide { max-width: 1200px; }
.tool-title { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.tool-title h2 { font-size: 24px; font-weight: 700; }
.tool-title p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.tool-box { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }

/* --- Modern Cool Upload Area --- */
.drop-zone { background: linear-gradient(145deg, #f8fafc, #e2e8f0); border: 2px dashed #94a3b8; border-radius: 20px; padding: 70px 20px; text-align: center; cursor: pointer; transition: all 0.3s ease; box-shadow: inset 0 0 20px rgba(255,255,255,0.8); }
.drop-zone:hover { border-color: var(--primary-color); background: linear-gradient(145deg, #f0f9ff, #e0f2fe); }
.upload-icon-wrap { background: #fff; width: 90px; height: 90px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15); }
.upload-icon-wrap i { font-size: 40px; color: #2563eb; }
.drop-zone h3 { font-size: 24px; margin-bottom: 8px; font-weight: 700; color: #1e293b; }
.drop-zone p { color: var(--text-muted); margin-bottom: 24px; font-size: 15px; }

.btn { border: 1px solid var(--border-color); background: #fff; color: var(--text-main); padding: 10px 22px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn:hover { background: #f1f5f9; }
.btn.primary { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.sm { padding: 8px 16px; font-size: 13px; }
.round-btn { border-radius: 50px !important; }
.round-icon { border-radius: 50% !important; width: 38px; height: 38px; padding: 0 !important; justify-content: center; border: 1px solid #e2e8f0; color: #475569;}

.text-danger { color: #dc2626 !important; border-color: #fecaca !important; }
.text-danger:hover { background: #fef2f2 !important; }

/* --- Premium Toolbar With Scrollbar --- */
.premium-toolbar { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 50px; display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); position: sticky; top: 80px; z-index: 50;}

.toolbar-scroll { display: flex; gap: 4px; padding-right: 15px; overflow-x: auto; padding-bottom: 5px; margin-bottom: -5px; }
.toolbar-scroll::-webkit-scrollbar { height: 6px; }
.toolbar-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.toolbar-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.toolbar-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.tool-tab { background: transparent; border: none; padding: 8px 16px; border-radius: 50px; font-size: 14px; font-family: var(--font-comic); font-weight: 600; color: #475569; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.2s; white-space: nowrap; }
.tool-tab i { font-size: 15px; }
.tool-tab:hover { background: #f1f5f9; color: var(--primary-color); }
.tool-tab.active { background: #2563eb; color: #ffffff; }

.toolbar-actions { display: flex; gap: 8px; padding-left: 10px; border-left: 1px solid #e2e8f0; }

.hint { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; border-radius: 50px; padding: 10px 20px; font-size: 13px; margin-bottom: 15px; font-weight: 500; text-align: center; }

/* Canvas Area */
.canvas-background { background: #cbd5e1; border-radius: 12px; padding: 30px; display: flex; justify-content: center; min-height: 500px; overflow-y: auto; position: relative; border: 1px solid #94a3b8; }
.loading-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; color: #475569; font-weight: 600; background: #fff; padding: 12px 24px; border-radius: 50px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); z-index: 10; display: flex; align-items: center; gap: 10px;}
.pages-area { display: flex; flex-direction: column; gap: 20px; }
.page-wrap { position: relative; background: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.15); border-radius: 2px; }
.page-wrap canvas { display: block; max-width: 100%; height: auto; }
/* --- Editor layers & objects --- */
.canvas-background { justify-content: flex-start; overflow: auto; }
.pages-area { margin: 0 auto; }
.page-wrap canvas { max-width: none; }
.layer { position: absolute; inset: 0; }
.hot { position: absolute; cursor: text; border-radius: 2px; }
.hot:hover { background: rgba(37,99,235,.14); outline: 1px dashed #2563eb; }
.obj { position: absolute; cursor: move; user-select: none; -webkit-user-select: none; }
.obj.sel { outline: 2px solid #2563eb; }
.obj[contenteditable] { cursor: text; outline: 2px solid #2563eb; background: #fff; min-width: 12px; min-height: 1em; user-select: text; -webkit-user-select: text; }
.rz { position: absolute; right: -7px; bottom: -7px; width: 13px; height: 13px; background: #2563eb; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
.rb { position: absolute; border: 2px dashed #2563eb; background: rgba(37,99,235,.1); pointer-events: none; }
.tool-draw .obj, .tool-draw .hot { pointer-events: none; }
.propsbar { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 50px; padding: 6px 18px; margin-bottom: 15px; font-size: 13px; font-weight: 600; position: sticky; top: 142px; z-index: 49; box-shadow: 0 4px 15px rgba(0,0,0,.05); }
.propsbar input[type=number] { width: 62px; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 6px; }
.propsbar input[type=color] { width: 32px; height: 26px; border: none; background: none; vertical-align: middle; cursor: pointer; }
