:root {
  --red: #ee1c25;
  --red-dark: #b3121a;
  --white: #ffffff;
  --off-white: #fff5f5;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* no page scrolling */
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--white);
  color: var(--red-dark);
}

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  flex: 0 0 auto;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.2rem;
  border-bottom: 4px solid var(--red-dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pokeball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--white) 0%, var(--white) 46%, var(--red-dark) 46%, var(--red-dark) 54%, var(--white) 54%, var(--white) 100%);
  border: 2px solid var(--white);
  position: relative;
  box-shadow: 0 0 0 2px var(--red-dark);
}
.pokeball::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--white);
  border: 2px solid var(--red-dark);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.brand-name {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.api-input {
  background: var(--white);
  color: var(--red-dark);
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  width: 190px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

/* ---------- Main ---------- */
.main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.panel {
  background: var(--off-white);
  border: 3px solid var(--red);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.4rem;
  overflow: hidden;
}

/* ---------- Tabs ---------- */
.tabs {
  flex: 0 0 auto;
  display: flex;
  border-bottom: 2px solid var(--red);
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.6rem 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--red-dark);
  opacity: 0.5;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.tab.active {
  opacity: 1;
  border-bottom: 3px solid var(--red);
}

/* ---------- Forms ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 0 0 auto;
}

.form-row {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red-dark);
  flex: 1;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select {
  border: 2px solid var(--red);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  color: var(--red-dark);
  background: var(--white);
  outline: none;
  font-family: inherit;
}

input:focus, select:focus {
  border-color: var(--red-dark);
}

.radio-row {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.radio {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid var(--white);
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.15);
}

.btn-outline {
  background: transparent;
  color: var(--red-dark);
  border: 1.5px solid var(--red);
}
 
.btn-outline:hover {
  background: var(--red);
  color: var(--white);
}
/* ---------- Messages & results ---------- */
.msg {
  flex: 0 0 auto;
  font-size: 0.85rem;
  min-height: 1.1em;
  margin: 0.5rem 0 0 0;
  font-weight: 600;
}

.msg.error { color: var(--red); }
.msg.success { color: var(--red-dark); }

.results {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card {
  border: 2px solid var(--red);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  background: var(--white);
}

.card-title {
  font-weight: 700;
  color: var(--red-dark);
  font-size: 0.95rem;
}

.card-sub {
  font-size: 0.8rem;
  color: var(--red);
  margin-top: 0.2rem;
}

.card-count {
  float: right;
  background: var(--red);
  color: var(--white);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.tabpanel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow: hidden;
}
