/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================= BASE ================= */
body {
  background: #0b1220;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, sans-serif;
  height: 100vh;
}

/* ================= LAYOUT ================= */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 110px;
  min-width: 90px;
  background: #020617;
  border-right: 1px solid #1e293b;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* SCROLLBONITO */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 10px;
}

/* THUMBNAILS */
.thumb {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.thumb:hover {
  transform: scale(1.05);
  border-color: #334155;
}

.thumb.active {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* ================= MAIN ================= */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ================= TOOLBAR ================= */
.toolbar {
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #1e293b;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* INPUT */
input[type="file"] {
  background: #020617;
  border: 1px solid #1e293b;
  color: #94a3b8;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}

/* ================= BOTÕES ================= */
button {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

/* HOVER */
button:hover {
  background: #334155;
  transform: translateY(-1px);
}

/* ACTIVE */
button:active {
  transform: scale(0.95);
}

/* BOTÃO PRINCIPAL (export) */
button:last-child {
  background: #0ea5e9;
  border: none;
  color: #fff;
}

button:last-child:hover {
  background: #0284c7;
}

/* ================= VIEWER ================= */
.viewer {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  padding: 20px;
  position: relative;
}

/* SCROLL */
.viewer::-webkit-scrollbar {
  width: 8px;
}
.viewer::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 10px;
}

/* ================= CANVAS ================= */
canvas {
  background: white;
  border-radius: 10px;
  max-width: 100%;
  box-shadow:
    0 10px 25px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.05);
  transition: transform 0.2s ease;
}

/* ================= INFO ================= */
#pageInfo {
  font-size: 14px;
  color: #94a3b8;
  min-width: 60px;
  text-align: center;
}

/* ================= RESPONSIVO ================= */
@media (max-width: 768px) {

  .sidebar {
    display: none; /* esconde no mobile */
  }

  .toolbar {
    justify-content: center;
    gap: 6px;
  }

  button {
    padding: 6px 8px;
    font-size: 12px;
  }

  input[type="file"] {
    width: 100%;
  }

  .viewer {
    padding: 10px;
  }

  canvas {
    width: 100%;
    height: auto;
  }
}

/* ================= MICRO UX ================= */

/* efeito de foco */
button:focus {
  outline: 2px solid #38bdf8;
}

/* seleção suave */
::selection {
  background: #38bdf8;
  color: #000;
}

.thumb.selected {
  border: 2px solid #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,0.6);
}