/* ============================================================
   Trello Clone - Stiluri
   ============================================================ */

:root {
  --bg: #1d2125;
  --surface: #22272b;
  --surface-2: #2c333a;
  --list-bg: #101204;
  --list-bg: #f1f2f4;
  --text: #172b4d;
  --text-light: #ffffff;
  --muted: #626f86;
  --primary: #0c66e4;
  --primary-hover: #0055cc;
  --danger: #c9372c;
  --shadow: 0 1px 2px rgba(9, 30, 66, 0.25);
  --shadow-lg: 0 8px 24px rgba(9, 30, 66, 0.28);
  --radius: 10px;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
}

body {
  background: #0079bf;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ---------- Butoane ---------- */
.btn {
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-block { width: 100%; }
.btn-ghost { background: rgba(255,255,255,0.18); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.30); }
.btn-ghost.danger { background: rgba(201,55,44,0.15); color: #ffd7d3; }
.btn-ghost.danger:hover { background: var(--danger); color: #fff; }

/* ---------- Ecran autentificare ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0079bf 0%, #5067c5 100%);
  padding: 20px;
}
.auth-card {
  background: #fff;
  width: 100%;
  max-width: 400px;
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  color: var(--primary);
  margin-bottom: 24px;
}
.auth-logo span { color: var(--text); }
.auth-tabs {
  display: flex;
  background: #f1f2f4;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  padding: 12px 14px;
  border: 2px solid #dfe1e6;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border 0.15s;
}
.auth-form input:focus { outline: none; border-color: var(--primary); }
.auth-error { color: var(--danger); font-size: 13px; min-height: 16px; text-align: center; }

/* ---------- Topbar ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 52px;
  background: rgba(0,0,0,0.30);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}
.topbar-logo {
  background: none; border: none; cursor: pointer;
  font-size: 20px; font-weight: 700; color: #fff;
}
.topbar-logo span { opacity: 0.7; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip { color: #fff; font-size: 14px; font-weight: 500; }

/* ---------- Lista de board-uri ---------- */
.boards-view { padding: 32px; max-width: 1100px; width: 100%; margin: 0 auto; }
.page-title { color: #fff; font-size: 22px; margin-bottom: 20px; }
.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.board-tile {
  height: 110px;
  border-radius: var(--radius);
  padding: 14px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.board-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.board-tile .board-meta { font-size: 12px; font-weight: 500; opacity: 0.85; }
.board-tile .tile-delete {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.3); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  font-size: 16px; line-height: 1; opacity: 0; transition: opacity 0.12s;
}
.board-tile:hover .tile-delete { opacity: 1; }
.board-tile .tile-delete:hover { background: var(--danger); }
.board-tile-add {
  height: 110px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.24);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.board-tile-add:hover { background: rgba(255,255,255,0.4); }

/* ---------- Vizualizare board ---------- */
.board-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.board-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
}
.board-title-text { color: #fff; font-size: 20px; flex: 1; }

.lists-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0 20px 20px;
  overflow-x: auto;
  flex: 1;
  min-height: 0;
}

/* ---------- Liste ---------- */
.list {
  background: var(--list-bg);
  border-radius: 12px;
  width: 280px;
  flex-shrink: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.list-header {
  display: flex;
  align-items: center;
  padding: 10px 8px 6px 12px;
}
.list-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  border: none;
  background: transparent;
  font-family: inherit;
  padding: 4px;
  border-radius: 4px;
}
.list-title:focus { outline: 2px solid var(--primary); background: #fff; }
.list-delete {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 18px; padding: 2px 6px; border-radius: 4px;
}
.list-delete:hover { background: #e1e3e6; color: var(--danger); }
.cards {
  list-style: none;
  padding: 4px 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 8px;
}
.card {
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}
.card:hover { background: #f7f8f9; }
.card.sortable-ghost { opacity: 0.4; }
.card.sortable-chosen { box-shadow: var(--shadow-lg); }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-label-dot { height: 8px; width: 36px; border-radius: 4px; }
.card-badges { display: flex; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); align-items: center; }
.card-badge { display: inline-flex; align-items: center; gap: 4px; }
.card-badge.due { background: #e2e4ea; padding: 2px 6px; border-radius: 4px; }
.card-badge.due.overdue { background: #ffd5d2; color: var(--danger); }

.add-card-btn {
  margin: 4px 8px 10px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.add-card-btn:hover { background: #e1e3e6; color: var(--text); }
.add-card-form { padding: 4px 8px 10px; }
.add-card-form textarea {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  box-shadow: var(--shadow);
}
.add-card-form textarea:focus { outline: 2px solid var(--primary); }
.add-card-form .row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

/* lista pentru adaugare lista noua */
.add-list {
  width: 280px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.24);
  border-radius: 12px;
  padding: 10px;
}
.add-list-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
}
.add-list-form input {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}
.add-list-form input:focus { outline: 2px solid var(--primary); }
.add-list-form .row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 16px; z-index: 100; overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-small { max-width: 400px; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 26px; cursor: pointer;
  color: var(--muted); line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-heading { margin-bottom: 16px; }
.modal-title-input {
  width: 100%;
  font-size: 18px;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  margin-bottom: 18px;
  background: #f1f2f4;
}
.modal-title-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.modal-section { margin-bottom: 18px; }
.modal-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.modal-textarea, .modal-date {
  width: 100%;
  border: 2px solid #dfe1e6;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.modal-textarea:focus, .modal-date:focus { outline: none; border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }

.label-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.label-swatch {
  width: 44px; height: 28px; border-radius: 6px; cursor: pointer;
  border: 3px solid transparent; transition: transform 0.1s;
}
.label-swatch:hover { transform: scale(1.08); }
.label-swatch.selected { border-color: #172b4d; }

.color-picker { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }
.color-swatch {
  width: 48px; height: 36px; border-radius: 8px; cursor: pointer;
  border: 3px solid transparent;
}
.color-swatch.selected { border-color: #172b4d; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #172b4d; color: #fff;
  padding: 12px 20px; border-radius: 8px;
  font-size: 14px; box-shadow: var(--shadow-lg);
  z-index: 200;
}

/* ---------- Scrollbar ---------- */
.lists-container::-webkit-scrollbar, .cards::-webkit-scrollbar { height: 10px; width: 8px; }
.lists-container::-webkit-scrollbar-thumb, .cards::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.25); border-radius: 8px;
}

.empty-state { color: rgba(255,255,255,0.85); font-size: 15px; padding: 20px 0; }
