:root {
  --primary: #ff7eb9;
  --primary-light: #ffb7d5;
  --secondary: #70d6ff;
  --accent: #ffbc42;
  --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --text: #2d3436;
  --text-muted: #636e72;
  --radius: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Login Page Styles */
.login-container {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  text-align: center;
}

.login-container h1 {
  margin-bottom: 30px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.5rem;
}

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

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-muted);
}

.input-group input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: rgba(255, 255, 255, 0.5);
  outline: none;
  transition: all 0.3s ease;
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 126, 185, 0.2);
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 10px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 126, 185, 0.4);
}

.btn:active {
  transform: translateY(0);
}

/* Dashboard Layout */
#app {
  width: 100%;
  height: 100vh;
  display: none; /* Hidden until login */
}

.dashboard {
  display: flex;
  width: 100%;
  height: 100%;
}

.sidebar {
  width: 280px;
  height: 100%;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--glass-border);
}

.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.3);
}

.card {
  padding: 25px;
  margin-bottom: 30px;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: scale(1.01);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

/* Profile Card */
.profile-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary-light), var(--secondary));
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: white;
}

/* Log Styles */
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
}

.log-item:hover {
  background: rgba(255, 255, 255, 0.5);
}

.log-time {
  font-weight: 600;
  color: var(--primary);
  min-width: 60px;
}

.log-content {
  flex: 1;
}

.log-category {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eee;
  margin-top: 5px;
  display: inline-block;
}

.cat-active { background: #ffeaa7; color: #d63031; }
.cat-passive { background: #fab1a0; color: #e17055; }
.cat-food { background: #55efc4; color: #00b894; }
.cat-activity { background: #81ecec; color: #00cec9; }

/* Soft Timeline Styles */
#daily-schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.timeline-item {
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 16px;
  padding: 15px;
  opacity: 0.6;
  transform: scale(0.98);
}

.timeline-item.active {
  opacity: 1;
  transform: scale(1.02);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 25px rgba(255, 126, 185, 0.15);
  border-left: 5px solid var(--primary);
}

.time-label {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
  margin-bottom: 8px;
  background: rgba(255, 126, 185, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  width: max-content;
}

.tl-title {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 5px;
}

.tl-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 30px;
}

/* Chart container */
.chart-container {
  height: 400px;
  position: relative;
}

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .nav-label {
    padding-left: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
  .dashboard {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-right: none;
    border-top: 1px solid var(--glass-border);
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }

  /* Hide profile info in bottom nav on mobile */
  .sidebar .profile-info {
    display: none;
  }
  
  .nav-label {
    display: none;
  }

  .sidebar-nav {
    margin-top: 0 !important;
    display: flex;
    flex-direction: row;
    gap: 5px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar for neatness */
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-nav .btn {
    margin-bottom: 0 !important;
    white-space: nowrap;
    padding: 10px;
    font-size: 0.85rem;
    flex: 1;
    min-width: max-content;
  }

  /* Adjust Logout button */
  .sidebar > div:last-child {
    display: none; /* Hide logout from bottom nav to save space, user can log out from profile settings if we move it, or just keep it */
  }

  /* Main Content Adjustments */
  .main-content {
    padding: 15px;
    padding-bottom: 80px; /* Space for bottom nav */
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .card {
    padding: 15px;
    margin-bottom: 15px;
  }

  .login-container {
    padding: 20px;
    width: 90%;
  }

  .chart-container {
    height: 250px; /* Smaller charts on mobile */
  }
}
