@charset "UTF-8";

:root {
  --color-primary: #2634a3;
  --color-primary-hover: #1a2580;
  --color-bg: #f0f4f8;
  --color-border: #e0e4ea;
  --color-text: #1a1a2e;
  --color-text-muted: #8a93a8;
  --color-surface: #ffffff;
  --header-height: 3rem;
  --activity-bar-collapsed: 52px;
  --activity-bar-expanded: 200px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Nunito", sans-serif;
  background: var(--color-bg);
  min-height: 100vh;
  color: var(--color-text);
}

/* ── Header ── */
header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.2rem;
  height: var(--header-height);
  gap: 0.6rem;
}

header .gearsIcon {
  height: 1.5rem;
}

header .appName {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
  display: flex;
  align-items: center;
}

header .appName span {
  margin-left: 6px;
  font-size: 0.55em;
  color: #888;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  background: #f0f0f0;
}

header .headerRight {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

header .authBtn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 0.4rem;
  color: #666;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

header .authBtn:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

header .authBtn .material-symbols-rounded { font-size: 18px; }

header .language {
  display: flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 0.4rem;
  color: #666;
  cursor: pointer;
  transition: background 0.15s;
}

header .language:hover { background: var(--color-bg); }
header .language .material-symbols-rounded { font-size: 20px; }

/* ── Layout ── */
main {
  display: flex;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* ── Activity Bar ── */
.activity-bar {
  width: var(--activity-bar-collapsed);
  min-width: var(--activity-bar-collapsed);
  height: 100%;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.activity-bar.expanded {
  width: var(--activity-bar-expanded);
  min-width: var(--activity-bar-expanded);
}

.activity-bar-toggle {
  width: var(--activity-bar-collapsed);
  min-width: var(--activity-bar-collapsed);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  flex-shrink: 0;
  transition: color 0.15s;
}

.activity-bar-toggle:hover { color: var(--color-primary); }

.activity-bar-item {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0 0 14px;
  cursor: pointer;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s;
}

.activity-bar-item:hover {
  background: #f5f6fa;
  color: #555;
}

.activity-bar-item.active {
  color: #5b6abf;
  border-left-color: #a0aadd;
  background: #f0f2fa;
  padding-left: 11px;
}

.activity-bar-item .material-symbols-rounded {
  font-size: 20px;
  flex-shrink: 0;
}

.activity-label {
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.activity-bar.expanded .activity-label { opacity: 1; }

/* ── Container ── */
.container {
  flex: 1;
  height: 100%;
  overflow-y: auto;
}

.content {
  max-width: 1100px;
  padding: 2rem 2rem;
  margin: 0 auto;
}

/* ── Shortcut Bar ── */
.shortcut-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.shortcut-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.4rem 1.6rem;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
  position: relative;
  overflow: hidden;
}

.shortcut-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.18s;
}

.shortcut-card:hover {
  border-color: #b0b8e8;
  box-shadow: 0 4px 16px rgba(91,106,191,0.13);
  transform: translateY(-2px);
}

.shortcut-card:hover::before {
  opacity: 1;
}

.shortcut-card-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcut-card-icon .material-symbols-rounded {
  font-size: 1.5rem;
}

.shortcut-card-robot .shortcut-card-icon {
  background: #e8eaff;
  color: #5b6abf;
}

.shortcut-card-world .shortcut-card-icon {
  background: #e6f4ea;
  color: #388e3c;
}

.shortcut-card-challenge .shortcut-card-icon {
  background: #fff8e1;
  color: #f59e0b;
}

.shortcut-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-text);
}

.shortcut-card-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-top: -0.4rem;
}

/* ── Tabs ── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.6rem 1.4rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s;
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ── Content Header ── */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Buttons ── */
.btn-new {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #eef0fb;
  color: #5b6abf;
  border: 1px solid #d0d4f0;
  border-radius: 0.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-new:hover {
  background: #e2e5f7;
  border-color: #b0b8e8;
}
.btn-new .material-symbols-rounded { font-size: 17px; }


/* ── Project List ── */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.7rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.project-item:hover {
  border-color: #c5cbdf;
  box-shadow: 0 2px 12px rgba(38, 52, 163, 0.08);
}

.project-item-icon {
  color: var(--color-primary);
  font-size: 1.3rem;
  flex-shrink: 0;
  opacity: 0.8;
}

.project-item-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
}

.project-item-date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.2rem;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: 0.3rem;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.btn-delete:hover {
  color: #e53935;
  background: #fdecea;
}

.btn-delete .material-symbols-rounded {
  font-size: 1.1rem;
}

/* ── Empty / Message ── */
.empty-msg {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  padding: 3rem 0;
  text-align: center;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--color-surface);
  border-radius: 1rem;
  padding: 1.8rem;
  width: 400px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.modal h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-text);
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal input {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  font-family: "Nunito", sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--color-bg);
}

.modal input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(38, 52, 163, 0.1);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.btn-cancel {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  cursor: pointer;
  color: #888;
  transition: background 0.15s;
}

.btn-cancel:hover { background: var(--color-bg); }

.btn-create {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.45rem 1.2rem;
  font-size: 0.88rem;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-create:hover { background: var(--color-primary-hover); }

.btn-delete-confirm {
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.45rem 1.2rem;
  font-size: 0.88rem;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-delete-confirm:hover { background: #c62828; }

/* ── Search ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  padding: 0.5rem 0.8rem;
  margin-bottom: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(38, 52, 163, 0.08);
}
.search-bar .material-symbols-rounded {
  font-size: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  font-family: "Nunito", sans-serif;
  color: var(--color-text);
  width: 100%;
}
.search-bar input::placeholder { color: var(--color-text-muted); }

/* ── Card Grid (robots, worlds) ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.card-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.9rem;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.card-item:hover {
  border-color: #c5cbdf;
  box-shadow: 0 4px 16px rgba(38, 52, 163, 0.1);
  transform: translateY(-2px);
}
.card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--color-bg);
  display: block;
}
.card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb-placeholder .material-symbols-rounded { font-size: 3rem; }
.card-thumb-placeholder.robot { background: #eef0fb; color: #a0aadd; }
.card-thumb-placeholder.world { background: #e6f4ea; color: #81c784; }
.card-body {
  padding: 0.75rem 0.9rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0 0.9rem 0.6rem;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  :root {
    --activity-bar-expanded: 160px;
  }

  .content {
    padding: 1.2rem 1rem;
  }

  .shortcut-bar {
    flex-direction: column;
  }

  .content-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .project-item-date {
    display: none;
  }
}

@media (max-width: 480px) {
  header .auth-label,
  header .appName {
    display: none;
  }

  .activity-bar,
  .activity-bar.expanded {
    width: var(--activity-bar-collapsed);
    min-width: var(--activity-bar-collapsed);
  }

  .activity-label {
    display: none;
  }

  .content {
    padding: 1rem 0.75rem;
  }
}
