/* ═══════════════════════════════════════════════════════════
   Flask Tracker – Premium Dark Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  line-height: 1.6;
}

a { color: #58a6ff; text-decoration: none; transition: color .15s; }
a:hover { color: #79c0ff; }

/* ── Layout shell ─────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: #161b22;
  border-right: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #e6edf3;
  letter-spacing: .02em;
}

.sidebar-header .sub {
  font-size: .75rem;
  color: #8b949e;
  margin-top: .15rem;
}

/* New project form in sidebar */
.sidebar-form {
  display: flex;
  gap: .4rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-form input {
  flex: 1;
  padding: .4rem .6rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  color: #c9d1d9;
  font-size: .8rem;
}

.sidebar-form input::placeholder { color: #484f58; }
.sidebar-form input:focus { outline: none; border-color: #58a6ff; box-shadow: 0 0 0 2px rgba(88,166,255,.15); }

.sidebar-form button {
  padding: .4rem .7rem;
  border: none;
  border-radius: 6px;
  background: #238636;
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.sidebar-form button:hover { background: #2ea043; }

/* Project list */
.project-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.project-list li {
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.project-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  font-size: .85rem;
  color: #c9d1d9;
  transition: background .15s;
}

.project-list li a:hover { background: rgba(255,255,255,.04); }
.project-list li.active a { background: rgba(88,166,255,.1); color: #58a6ff; font-weight: 600; }

.project-list .badge {
  background: rgba(255,255,255,.08);
  padding: .1rem .45rem;
  border-radius: 10px;
  font-size: .7rem;
  color: #8b949e;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f85149;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 .35rem;
  border-radius: 10px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,81,73,.4); }
  50%      { box-shadow: 0 0 0 4px rgba(248,81,73,0); }
}

.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: .8rem;
}

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.main-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 1rem;
}

.main-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e6edf3;
  margin: 1.5rem 0 .75rem;
}

/* ── Cards (glassmorphism) ────────────────────────────────── */
.card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(12px);
  animation: fadeIn .4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Flash messages ───────────────────────────────────────── */
.flash { padding: .6rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .85rem; }
.flash.success { background: rgba(35,134,54,.15); color: #3fb950; border: 1px solid rgba(35,134,54,.3); }
.flash.danger  { background: rgba(248,81,73,.1);  color: #f85149; border: 1px solid rgba(248,81,73,.2); }

/* ── Inline forms ─────────────────────────────────────────── */
.inline-form {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form input[type="text"] {
  padding: .45rem .7rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  color: #c9d1d9;
  font-size: .85rem;
  min-width: 200px;
}
.inline-form input[type="text"]::placeholder { color: #484f58; }
.inline-form input[type="text"]:focus { outline: none; border-color: #58a6ff; box-shadow: 0 0 0 2px rgba(88,166,255,.15); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .45rem .85rem;
  border: none;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}

.btn-primary { background: #238636; color: #fff; }
.btn-primary:hover { background: #2ea043; }

.btn-danger { background: rgba(248,81,73,.15); color: #f85149; border: 1px solid rgba(248,81,73,.2); }
.btn-danger:hover { background: rgba(248,81,73,.25); }

.btn-sm { padding: .3rem .6rem; font-size: .75rem; }

.btn-ghost { background: transparent; color: #8b949e; border: 1px solid rgba(255,255,255,.1); }
.btn-ghost:hover { background: rgba(255,255,255,.06); color: #c9d1d9; }

/* ── Tables ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.data-table th {
  text-align: left;
  padding: .6rem .75rem;
  background: rgba(255,255,255,.04);
  color: #8b949e;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.data-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: top;
  word-break: break-word;
}

.data-table tbody tr:hover { background: rgba(255,255,255,.02); }

.mono {
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  color: #79c0ff;
}

.copy-input {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px;
  padding: .25rem .5rem;
  color: #79c0ff;
  font-family: monospace;
  font-size: .8rem;
  width: 100%;
  max-width: 320px;
}

.badge-count {
  display: inline-block;
  background: rgba(88,166,255,.15);
  color: #58a6ff;
  padding: .15rem .55rem;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

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

.modal-box {
  background: #1c2128;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 700px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: fadeIn .25s ease;
}

.modal-box .close-btn {
  position: absolute;
  top: .75rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8b949e;
  background: none;
  border: none;
  transition: color .15s;
}
.modal-box .close-btn:hover { color: #f85149; }

.modal-box pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-family: monospace;
  font-size: .8rem;
  color: #c9d1d9;
  line-height: 1.5;
}

/* ── Login page ───────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 360px;
  backdrop-filter: blur(12px);
  animation: fadeIn .5s ease;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #e6edf3;
}

.login-card label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #8b949e;
  margin-bottom: .3rem;
}

.login-card input {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  color: #c9d1d9;
  font-size: .9rem;
  margin-bottom: 1rem;
}

.login-card input:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 2px rgba(88,166,255,.15);
}

.login-card .btn-primary {
  width: 100%;
  padding: .65rem;
  font-size: .9rem;
}

/* ── Tracked landing page ─────────────────────────────────── */
.tracked-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.tracked-wrapper p { font-size: 1rem; color: #8b949e; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #484f58;
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-state p { font-size: .9rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; min-width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
  .main-content { padding: 1rem; }
}
