:root {
  /* Colors */
  --bg-navy: #0a1428;
  --panel-bg: rgba(16, 30, 60, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent-cyan: #00e5ff;
  --accent-blue: #2979ff;
  --text-main: #f0f4f8;
  --text-muted: #94a3b8;
  --error-red: #ff3366;
  
  /* Styling */
  --font-main: 'Outfit', sans-serif;
  --border-radius: 20px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-navy);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  /* Dark textured background */
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(41, 121, 255, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 229, 255, 0.08), transparent 25%);
}

.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ?? LOGIN SCREEN ????????????????????????????? */
#login-screen {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 40px 30px;
  border-radius: var(--border-radius);
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  text-align: center;
}

/* Decorative Orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
  opacity: 0.4;
}
.orb-1 {
  width: 150px;
  height: 150px;
  background: var(--accent-blue);
  top: -50px;
  left: -50px;
}
.orb-2 {
  width: 100px;
  height: 100px;
  background: var(--accent-cyan);
  bottom: -20px;
  right: -20px;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  background: linear-gradient(to right, #82b1ff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

.primary-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border: none;
  color: rgba(10, 20, 40, 0.65);
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
}

.error-msg {
  color: var(--error-red);
  font-size: 0.85rem;
  min-height: 20px;
  margin-bottom: 10px;
}

/* ── APP SHELL & NAVIGATION ───────────────────────────── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(10, 20, 40, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.app-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(to right, #82b1ff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-family: var(--font-main);
  font-weight: 500;
  cursor: pointer;
}

.app-content {
  flex: 1;
  padding: 20px 20px 100px 20px;
  overflow-y: auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

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

.tab-pane h2 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

/* Glass Panel Reusable */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
}

/* ── PHASE 3: CURRENT STATE DASHBOARD ────────────────── */
.summary-box {
  border-left: 4px solid var(--accent-cyan);
}

.summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}
.status-indicator.warning { background: #ffb74d; box-shadow: 0 0 10px #ffb74d; }
.status-indicator.critical { background: var(--error-red); box-shadow: 0 0 10px var(--error-red); }

.summary-box p {
  color: var(--text-main);
  line-height: 1.5;
  font-size: 0.95rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px 20px;
  margin-bottom: 0;
}

.kpi-icon {
  font-size: 1.8rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.kpi-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.35;
}

.text-warning { color: #ffb74d; }
.text-critical { color: var(--error-red); }
.text-safe { color: #81c784; }

/* ── PHASE 4: FOLDERS & TIMELINE ────────────────── */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
}

.folder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 0;
}

.folder-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.folder-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.folder-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.folder-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.timeline-entry {
  padding: 15px;
  margin-bottom: 0;
}

.timeline-entry.archived {
  opacity: 0.6;
  border-style: dashed;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.timeline-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.2);
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
}

.tag-trigger { background: rgba(255, 51, 102, 0.2); color: var(--error-red); }
.tag-food { background: rgba(129, 199, 132, 0.2); color: #81c784; }
.tag-hint { background: rgba(41, 121, 255, 0.2); color: var(--accent-blue); }

.timeline-text {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.timeline-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── FAVORITES MOCK SCREEN ────────────────────────── */
.favorite-item {
  padding: 0;
  overflow: hidden;
}

.fav-header {
  display: flex;
  align-items: center;
  padding: 20px;
  cursor: pointer;
}

.fav-icon {
  font-size: 1.5rem;
  margin-right: 15px;
}

.fav-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.fav-current {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.chevron {
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.favorite-item.active .chevron {
  transform: rotate(180deg);
}

.fav-history {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid transparent;
}

.favorite-item.active .fav-history {
  max-height: 300px;
  border-top: 1px solid var(--glass-border);
}

.history-entry {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.history-entry:last-child {
  border-bottom: none;
}

.history-date {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-val {
  font-size: 0.9rem;
}
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  padding: 15px 10px;
  border-radius: 20px 20px 0 0;
  border-bottom: none;
  z-index: 100;
  margin-bottom: 0;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-item span {
  font-size: 0.75rem;
  font-family: var(--font-main);
}

.nav-item.active {
  color: var(--accent-cyan);
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border: none;
  color: var(--bg-navy);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.4);
  cursor: pointer;
  z-index: 99;
  transition: all 0.3s ease;
}

.fab:hover {
  transform: scale(1.05);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  border-radius: 24px 24px 0 0;
  padding: 25px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-bottom: 0;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
}

textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 15px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 1rem;
  resize: none;
  margin-bottom: 10px;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
}
