body, html {
      margin: 0; 
      padding: 0; 
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: #f0f4f8;
      color: #333;
      height: 100vh;
    }
    .dashboard {
      display: flex;
      width: 100%;
      height: 100vh;
    }
    /* Sidebar */
    .sidebar {
      width: 240px;
      background: #1e3a8a; /* dark blue */
      color: #fff;
      display: flex;
      flex-direction: column;
      padding-top: 20px;
      box-shadow: 3px 0 10px rgba(0,0,0,0.1);
      user-select: none;
    }
    .sidebar-header h2 {
      text-align: center;
      font-weight: 700;
      margin-bottom: 30px;
      letter-spacing: 1px;
      font-size: 1.6rem;
    }
    .sidebar-nav {
      list-style: none;
      padding-left: 0;
      margin: 0;
      flex-grow: 1;
    }
    .sidebar-nav li {
      padding: 15px 30px;
      cursor: pointer;
      font-size: 1.1rem;
      display: flex;
      align-items: center;
      gap: 15px;
      border-left: 4px solid transparent;
      transition: background 0.3s ease, border-left 0.3s ease;
    }
    .sidebar-nav li:hover,
    .sidebar-nav li.active {
      background: #2563eb;
      border-left: 4px solid #fbbf24; /* yellow highlight */
    }
    /* Main content */
    .main-content {
      flex-grow: 1;
      background: white;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      padding: 40px 60px;
      box-sizing: border-box;
      height: 100%;
      max-height: 100vh;
    }
    .top-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 30px;
      gap: 15px;
      font-size: 1rem;
      color: #555;
    }
    .user-info {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 600;
      color: #1e293b;
      margin-left: auto;
    }
    .avatar {
      background: #2563eb;
      color: white;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      font-weight: 700;
      font-size: 1.2rem;
      text-transform: uppercase;
      user-select: none;
      box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
    }

    .card {
      padding: 40px;
      border-radius: 12px;
      color: white;
      text-align: center;
      font-size: 18px;
      box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
      transition: transform 0.2s ease;
      cursor: default;
    }
    .card:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 20px rgb(0 0 0 / 0.15);
    }
  .card.blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #fff;
}

.card.green {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: #fff;
}

.card.yellow {
  background: linear-gradient(135deg, #fceabb 0%, #f8b500 100%);
  color: #fff;
}

.card.red {
  background: linear-gradient(135deg, #f85032 0%, #e73827 100%);
  color: #fff;
}
    /* Sections */
    .section {
      display: none;
      width: 100%;
      min-height: 100%;
      box-sizing: border-box;
      flex-shrink: 0;
    }
    .section.active {
      display: block;
      animation: fadeIn 0.4s ease forwards;
    }
    @keyframes fadeIn {
      from {opacity: 0;}
      to {opacity: 1;}
    }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 10px;
padding: 20px;
}

.section{
    max-width: 100%;
}
    /* Popup */
    .popup {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.5);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
    }
    .popup.hidden {
      display: none;
    }
    .popup-content {
      background: white;
      padding: 30px 40px;
      border-radius: 10px;
      box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
      text-align: center;
      max-width: 320px;
      user-select: none;
    }
    .popup-content p {
      margin-bottom: 25px;
      font-size: 1.2rem;
      font-weight: 600;
      color: #111;
    }
    .popup-content button {
      padding: 10px 20px;
      margin: 0 10px;
      border: none;
      border-radius: 6px;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.3s ease;
    }
    #confirmLogout {
      background: #ef4444;
      color: white;
    }
    #confirmLogout:hover {
      background: #dc2626;
    }
    #cancelLogout {
      background: #94a3b8;
      color: white;
    }
    #cancelLogout:hover {
      background: #64748b;
    }
/* Cards container shared styling */
.progress-cards .card {
  background: linear-gradient(145deg, #ffffff, #f2f6fa);
  color: #1f2d3d;
  padding: 2.5rem 3rem;
  border-radius: 20px;
  min-width: 320px;
  min-height: 200px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  font-size: 1.2rem;
  font-weight: 600;
  border: 2px solid rgba(0, 123, 255, 0.15);  /* <== classy border */
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: default;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Hover glow + border pop */
.progress-cards .card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 123, 255, 0.4); /* stronger border on hover */
}

/* Optional shimmer effect */
.progress-cards .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease-in-out;
}

.progress-cards .card:hover::before{
  left: 130%;
}

/* Highlighted glow effect */
.highlighted {
  animation: highlight-glow 1.2s ease-in-out 2;
}

@keyframes highlight-glow {
  0% {
    box-shadow: 0 0 0px rgba(0, 123, 255, 0);
    border-color: transparent;
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(0, 123, 255, 0.6);
    border-color: #007bff;
  }
  100% {
    box-shadow: 0 0 0px rgba(0, 123, 255, 0);
    border-color: rgba(0, 123, 255, 0.15);
  }
}
.goals-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.goal-form-modern,
.goal-progress-modern {
  flex: 1 1 280px;
  background: linear-gradient(to bottom, #e0f2fe, #f0f9ff); /* blue-ish inner gradient */
  padding: 1.8rem;
  border-radius: 20px;
  border: 4px solid #fca968; /* orangish-cream border */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.goal-form-modern:hover,
.goal-progress-modern:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.goal-form-modern h4,
.goal-progress-modern h4 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: #1e3a8a; /* dark navy blue */
}

.input-group {
  position: relative;
  margin-bottom: 1.2rem;
}

.input-group input {
  width: 100%;
  padding: 0.9rem 0.75rem;
  font-size: 1rem;
  border: 2px solid #90cdf4; /* soft blue border */
  border-radius: 12px;
  background: #eff6ff; /* icy light blue */
  outline: none;
  color: #1e40af;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-group label {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  background-color: #e0f2fe; /* matches blue inner */
  padding: 0 0.35rem;
  color: #475569;
  font-size: 1rem;
  pointer-events: none;
  transition: 0.2s ease;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: -10px;
  left: 0.65rem;
  font-size: 0.8rem;
  color: #1d4ed8;
}

.goal-form-modern button {
  background-color: #1d4ed8; /* strong blue */
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.goal-form-modern button:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
}

.status-message {
  height: 1.2rem;
  margin-top: 0.5rem;
  font-weight: 500;
  color: green;
}

.goal-progress-modern p {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  color: #1e3a8a;
}

.progress-pill {
  background-color: #dbeafe;
  color: #1e40af;
  display: inline-flex;
  gap: 0.75rem;
  padding: 0.5rem 1.2rem;
  border-radius: 9999px;
  font-weight: bold;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
}
/* === Badges Section: Glassy + Gradient Glow === */
.badges-section {
  margin-top: 60px;
  padding: 40px;
  border-radius: 20px;
  max-width: 1000px;
  margin-inline: auto;
  background: linear-gradient(135deg, #30cfd0, #330867);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

/* Sparkles for background */
.badges-section::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  background: url('https://www.transparenttextures.com/patterns/stardust.png');
  opacity: 0.05;
  animation: floatBG 60s linear infinite;
  pointer-events: none;
  top: -50%;
  left: -50%;
}

@keyframes floatBG {
  0% { transform: translate(0, 0); }
  100% { transform: translate(100px, 100px); }
}

/* Section Title Fix */
.badges-section .sub-heading {
  margin-bottom: 30px;
  font-weight: 800;
  font-size: 28px;
  color: #fff;
  text-align: center;
  letter-spacing: 1px;
  animation: fadeIn 1s ease;
}

/* Badges Flex Container */
.badges-container {
  display: flex;
  justify-content: center;
  gap: 35px;
  flex-wrap: wrap;
  padding: 10px;
  animation: fadeIn 1.2s ease-in-out;
}

/* === Badge Card Styling === */
.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 130px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.85); /* White glassy look by default */
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
  cursor: default;
  position: relative;
}

.badge:hover {
  transform: translateY(-6px) scale(1.07);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25), 0 0 25px rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 1); /* Full white on hover */
}

/* Badge Image */
.badge img {
  width: 65px;
  height: 65px;
  margin-bottom: 10px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.badge:hover img {
  transform: rotate(5deg) scale(1.15);
}

/* Badge Text */
.badge p {
  font-weight: 700;
  color: #333;
  font-size: 16px;
  text-align: center;
  margin-top: 5px;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.4);
}

/* Locked Badge Style */
.badge.locked {
  filter: grayscale(100%);
  opacity: 0.5;
  pointer-events: none;
}

/* Unlocked Badge Glow */
.badge.unlocked {
  filter: none;
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 0 15px #4caf50;
}

/* Entry Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
/* === Responsive Layout Adjustments === */
@media (max-width: 1024px) {
  .dashboard {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 0;
    height: auto;
    overflow-x: auto;
  }

  .sidebar-header {
    display: none; /* hide the big title */
  }

  .sidebar-nav {
    flex-direction: row;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
  }

  .sidebar-nav li {
    padding: 10px 16px;
    font-size: 1rem;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .sidebar-nav li:hover,
  .sidebar-nav li.active {
    background: #2563eb;
    border-bottom: 3px solid #fbbf24;
  }

  .main-content {
    padding: 20px 30px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

/* === For mobile screens === */
@media (max-width: 600px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .user-info {
    margin-left: 0;
  }

  .goal-form-modern,
  .goal-progress-modern {
    flex: 1 1 100%;
    padding: 1.2rem;
  }

  .badges-section {
    padding: 20px;
    margin-top: 40px;
  }

  .popup-content {
    width: 90%;
    max-width: none;
    padding: 20px;
  }

  .card {
    padding: 20px;
    font-size: 1rem;
  }

  .progress-cards .card {
    padding: 1.5rem;
    font-size: 1rem;
    min-height: auto;
  }

  .section {
    padding: 10px 15px;
  }
}