/* Hello2Code Kids — Lobby
   Palette: #48076a | #ffa800 | #d046d9 | #01bebc | #6ce67d
*/

@font-face {
  font-family: 'Rubik';
  src: url('ardublockly/font/Rubik/Rubik-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Rubik';
  src: url('ardublockly/font/Rubik/Rubik-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Rubik';
  src: url('ardublockly/font/Rubik/Rubik-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Rubik', 'Arial Rounded MT Bold', Arial, sans-serif;
  min-height: 100vh;
  background: #f0e8ff;
}

/* ── Header ─────────────────────────────────────────── */

.lobby-header {
  background: #ffffff;
  padding: 5px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 10px solid #772eff;
  box-shadow: 0 2px 12px rgba(72, 7, 106, 0.08);
  position: sticky;
  top: 0;
  z-index: 0;
}

.dist{
  padding-right: 100px;
}
.lobby-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lobby-header .logo {
  height: 46px;
  display: block;
}

.lobby-header-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #48076a;
  letter-spacing: 0.3px;
}

.lobby-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffa800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1),
              box-shadow 0.2s ease;
}

.lobby-header-avatar:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 14px rgba(255, 168, 0, 0.45);
}

/* ── Title bar ──────────────────────────────────────── */

.lobby-title-bar {
  background: #48076a;
  padding: 9px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(72, 7, 106, 0.25);
}

.lobby-title-bar h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
}

.lobby-title-bar-crumb {
  font-size: 0.78rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lobby-title-bar-crumb span {
  color: #ffa800;
  font-weight: 700;
}
.highlighted {
    color: #ffa800;
}
/* ── Main grid area ─────────────────────────────────── */

.lobby-main {
  padding: 36px 32px 60px;
  max-width: 1280px;
  margin: 0 auto;
}

#projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 28px;
}

/* ── Base card ──────────────────────────────────────── */

.project-card {
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1),
              box-shadow 0.2s ease;
  position: relative;
  background: #fff;
  user-select: none;
  outline: none;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-7px) scale(1.04);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.project-card:active {
  transform: translateY(-2px) scale(1.01);
}

/* ── "+" Add card ───────────────────────────────────── */

.project-card--add {
  background: #fff;
  border: 3.5px dashed #ffa800;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.project-card--add:hover,
.project-card--add:focus-visible {
  background: #fff9ee;
  border-color: #e59400;
}

.add-icon {
  font-size: 4.5rem;
  font-weight: 800;
  color: #ffa800;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1);
}

.project-card--add:hover .add-icon {
  transform: rotate(15deg) scale(1.25);
}

.add-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffa800;
}

/* ── Existing project card ──────────────────────────── */

.project-card--existing {
  min-height: 210px;
  display: flex;
  flex-direction: column;
}

.card-thumbnail {
  width: 100%;
  height: 145px;
  object-fit: cover;
  display: block;
  background: #eee;
  flex-shrink: 0;
}

.card-thumbnail--placeholder {
  height: 145px;
  display: block;
  flex-shrink: 0;
}

.card-footer {
  padding: 11px 14px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.card-date {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

/* ── Delete button ──────────────────────────────────── */

.card-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease;
  z-index: 2;
  padding: 0;
}

.project-card:hover .card-delete-btn,
.project-card:focus-within .card-delete-btn {
  opacity: 1;
}

.card-delete-btn:hover {
  background: #e53935;
  transform: scale(1.15);
}

/* ── Dialogs ────────────────────────────────────────── */

dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: 22px;
  padding: 0;
  box-shadow: 0 16px 48px rgba(72, 7, 106, 0.32);
  max-width: 400px;
  width: 90%;
  font-family: 'Rubik', sans-serif;
  overflow: hidden;
  animation: dialog-in 0.22s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

dialog::backdrop {
  background: rgba(72, 7, 106, 0.38);
  backdrop-filter: blur(4px);
}

.dialog-header {
  background: #48076a;
  padding: 18px 24px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.dialog-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.dialog-header h3 {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.dialog-body {
  padding: 22px 24px 14px;
  background: #fff;
}

.dialog-body p {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 14px;
  line-height: 1.5;
}

.dialog-body input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 2.5px solid #d046d9;
  border-radius: 14px;
  font-size: 1rem;
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  color: #333;
}

.dialog-body input[type="text"]:focus {
  border-color: #48076a;
  box-shadow: 0 0 0 3px rgba(72, 7, 106, 0.12);
}

.dialog-body input[type="text"].input-error {
  border-color: #e53935;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

.dialog-footer {
  padding: 12px 24px 22px;
  background: #fff;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-dialog {
  padding: 11px 26px;
  border-radius: 14px;
  border: none;
  font-family: 'Rubik', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  letter-spacing: 0.3px;
}

.btn-dialog:active {
  transform: scale(0.95);
}

.btn-dialog--confirm {
  background: #ffa800;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 168, 0, 0.38);
}

.btn-dialog--confirm:hover {
  background: #e59400;
  box-shadow: 0 6px 18px rgba(255, 168, 0, 0.5);
}

.btn-dialog--cancel {
  background: #f0f0f0;
  color: #666;
}

.btn-dialog--cancel:hover {
  background: #e0e0e0;
}

.btn-dialog--danger {
  background: #e53935;
  color: #fff;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.32);
}

.btn-dialog--danger:hover {
  background: #c62828;
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 600px) {
  .lobby-main {
    padding: 20px 16px 48px;
  }

  #projects-grid {
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .card-thumbnail,
  .card-thumbnail--placeholder {
    height: 110px;
  }

  .project-card--add {
    min-height: 160px;
  }

  .add-icon {
    font-size: 3.5rem;
  }
}
