/* ============================================
   NOTEVAULT — Task Manager
   Theme: Deep dark, professional
   ============================================ */

:root {
  --bg:            #090910;
  --bg-2:          #0f0f1a;
  --bg-3:          #16162a;
  --bg-card:       #111120;
  --bg-select:     #1a1a2e;
  --border:        #1e1e35;
  --border-2:      #2a2a45;

  --accent:        #4f8ef7;
  --accent-light:  rgba(79,142,247,0.12);
  --accent-hover:  #6aa0ff;

  --text:          #eeeef8;
  --text-2:        #9090b8;
  --text-3:        #555575;

  --success:       #34d399;
  --success-light: rgba(52,211,153,0.12);
  --danger:        #f87171;
  --danger-light:  rgba(248,113,113,0.12);
  --warning:       #fbbf24;
  --warning-light: rgba(251,191,36,0.12);

  --radius:        14px;
  --radius-sm:     8px;
  --ease:          cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --speed:         0.22s;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; }

/* ===== CONTAINER ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,16,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--speed) var(--ease);
}
.back-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateX(-2px);
}

.logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.stats { display: flex; align-items: center; gap: 1.5rem; }
.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}
.stat-item i { color: var(--success); }

/* ===== HERO ===== */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

.hero-tag {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: inline-block;
}

.hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.hero h1 span { color: var(--accent); }

.hero-sub { font-size: 1rem; color: var(--text-2); }

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

/* ===== TODO WRAPPER ===== */
.todo-wrapper { padding: 2rem 0 4rem; }

/* ===== INPUT SECTION ===== */
.input-section {
  margin-bottom: 2rem;
  animation: slideUp 0.5s ease-out 0.1s both;
}

.input-group { display: flex; gap: 0.75rem; }

#task-input {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  transition: all var(--speed) var(--ease);
}
#task-input::placeholder { color: var(--text-3); }
#task-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(79,142,247,0.06);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.add-btn {
  padding: 1rem 1.8rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--speed) var(--ease);
  white-space: nowrap;
}
.add-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79,142,247,0.3);
}
.add-btn:active { transform: translateY(0); }

/* ===== CONTROLS ROW ===== */
.controls-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  animation: slideUp 0.5s ease-out 0.15s both;
  flex-wrap: wrap;
  align-items: flex-end;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 150px;
}

.control-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ──────────────────────────────────────────────
   FIXED SELECT DROPDOWNS
   - Fully dark background on the trigger
   - color-scheme: dark forces the native picker
     popup to also use a dark/contrasting theme
     in Chromium & Firefox
   - Explicit option colors as fallback
   ────────────────────────────────────────────── */
.control-select {
  width: 100%;
  padding: 0.8rem 2.8rem 0.8rem 1rem;
  background-color: var(--bg-select);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease),
              background-color var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease);
  /* Remove native arrow, replace with custom SVG */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%239090b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  /* CRITICAL: tells browser to render native dropdown UI in dark mode */
  color-scheme: dark;
}

.control-select:hover {
  border-color: var(--accent);
  background-color: #1e1e35;
}

.control-select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #1e1e35;
  box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
  color: var(--text);
}

/* Option styling — dark bg + bright text */
.control-select option {
  background-color: #1a1a2e;
  color: #eeeef8;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
}

.control-select option:checked {
  background-color: #2a2a4a;
  color: #ffffff;
  font-weight: 600;
}

/* Secondary / ghost button */
.btn-secondary {
  padding: 0.8rem 1.2rem;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--speed) var(--ease);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.btn-secondary:hover { color: var(--text); background: var(--bg-2); }
.btn-secondary.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-light);
}

.btn-primary {
  padding: 0.8rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--speed) var(--ease);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,142,247,0.25);
}

/* ===== STATISTICS ===== */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  animation: slideUp 0.5s ease-out 0.2s both;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--speed) var(--ease);
}
.stat-card:hover {
  border-color: var(--border-2);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.stat-icon {
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.total  { background: rgba(79,142,247,0.2);  color: var(--accent); }
.stat-icon.active { background: var(--warning-light);  color: var(--warning); }
.stat-icon.done   { background: var(--success-light);  color: var(--success); }

.stat-info { flex: 1; }

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

.stat-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
}

/* ===== TASKS SECTION ===== */
.tasks-section { animation: slideUp 0.5s ease-out 0.25s both; }

.tasks-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  justify-content: space-between;
}
.tasks-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.task-count-badge {
  padding: 0.4rem 0.9rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tasks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ===== TASK ITEM ===== */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--speed) var(--ease);
  animation: slideUp 0.35s ease-out both;
}
.task-item:hover {
  border-color: var(--accent);
  background: rgba(79,142,247,0.05);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(79,142,247,0.1);
}
.task-item.completed { opacity: 0.6; background: rgba(52,211,153,0.03); }
.task-item.completed:hover {
  border-color: var(--success);
  background: var(--success-light);
  opacity: 0.8;
}

.task-checkbox {
  flex-shrink: 0;
  width: 20px; height: 20px;
  cursor: pointer;
  accent-color: var(--success);
  margin-top: 4px;
  transition: transform var(--speed);
}
.task-checkbox:hover { transform: scale(1.15); }

.task-content { flex: 1; min-width: 0; }

.task-text {
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
  transition: all var(--speed);
}
.task-item.completed .task-text {
  color: var(--text-3);
  text-decoration: line-through;
}

.task-time {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.task-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.task-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.85rem;
  transition: all var(--speed) var(--ease);
}
.task-btn:hover        { border-color: var(--border-2); color: var(--text); }
.task-btn.edit:hover   { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.task-btn.delete:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state.hidden { display: none; }

.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.7; }
.empty-state h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.empty-state p { color: var(--text-2); font-size: 0.95rem; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}
.modal.hidden { display: none; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1001;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  max-width: 460px;
  width: 92%;
  animation: slideUp 0.25s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.85rem;
  transition: all var(--speed);
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-light); }

.modal-body { padding: 1.5rem; }

.modal-input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  transition: all var(--speed);
}
.modal-input::placeholder { color: var(--text-3); }
.modal-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(79,142,247,0.06);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1.4rem 1.5rem;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.modal-footer .btn-secondary,
.modal-footer .btn-primary { flex: 1; justify-content: center; }

/* ===== FOOTER ===== */
.footer {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header-inner { padding: 0 1rem; height: 60px; gap: 1rem; }
  .back-btn     { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
  .logo         { font-size: 1rem; }
  .hero h1      { font-size: 2rem; }
  .container    { padding: 0 1rem; }

  .input-group  { flex-direction: column; }
  .add-btn      { width: 100%; justify-content: center; }

  .controls-row  { gap: 0.75rem; }
  .control-group { min-width: 120px; }
  .btn-secondary { flex: 1; }

  .stats-section { grid-template-columns: 1fr; gap: 1rem; }
  .stat-icon     { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-value    { font-size: 1.4rem; }

  .tasks-header  { flex-wrap: wrap; gap: 0.75rem; }
  .task-item     { padding: 1rem; gap: 0.75rem; }
  .task-btn      { width: 32px; height: 32px; font-size: 0.75rem; }

  .modal-content { width: 95%; }
  .modal-footer  { flex-direction: column; }
  .modal-footer button { width: 100%; }
}
