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

:root {
  --body-bg: #f9f9fc;
  --primary-red: #e60037; /* Vibrant raspberry red from screenshot */
  --secondary-yellow: #ffd000; /* Sunflower yellow ring color */
  --royal-purple: #3c094d; /* Deep eggplant/plum purple card color */
  --tree-green: #76b729; /* Fresh leaf green from the logo */
  --text-dark: #333333;
  --text-light: #ffffff;
  --card-bg: #ffffff;
  
  --title-font: "Fredoka", sans-serif;
  --body-font: "Jost", sans-serif;
  
  /* Super bubble corners */
  --radius-bubble: 60px;
  --radius-pill: 50px;
  --radius-standard: 24px;
}

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

body {
  font-family: var(--body-font);
  background-color: var(--body-bg);
  background-image: 
    radial-gradient(var(--secondary-yellow) 10%, transparent 11%),
    radial-gradient(rgba(118, 183, 41, 0.15) 10%, transparent 11%);
  background-size: 60px 60px;
  background-position: 0 0, 30px 30px;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header style from screenshot */
header {
  background-color: #ffffff;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-img {
  height: 45px;
  width: auto;
}

.brand-name {
  font-family: var(--title-font);
  font-size: 1.5rem;
  color: var(--tree-green);
  font-weight: 700;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.logo-mature-container {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background-color: white;
  border: 4px solid var(--secondary-yellow);
  margin: 0 auto 20px auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.logo-mature-container img {
  height: 65px;
  width: 65px;
  object-fit: contain;
}

/* Big playful bubble card container */
.bubble-container {
  position: relative;
  margin: 40px auto;
  max-width: 750px;
  width: 90%;
  z-index: 10;
}

/* The decorative yellow ring peaking behind the card */
.deco-ring {
  position: absolute;
  width: 260px;
  height: 260px;
  border: 55px solid var(--secondary-yellow);
  border-radius: 50%;
  top: -60px;
  right: -50px;
  z-index: -1;
  pointer-events: none;
  animation: float 6s ease-in-out infinite alternate;
}

.deco-ring-left {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 35px solid rgba(118, 183, 41, 0.3);
  border-radius: 50%;
  bottom: -40px;
  left: -60px;
  z-index: -1;
  pointer-events: none;
  animation: float 8s ease-in-out infinite alternate-reverse;
}

/* The Bubble Card itself */
.card-bubble {
  background-color: var(--royal-purple);
  color: var(--text-light);
  border-radius: var(--radius-bubble);
  padding: 55px 45px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(60, 9, 77, 0.25);
  border: none;
  position: relative;
}

.card-bubble h2, .card-bubble h3 {
  font-family: var(--title-font);
  color: var(--text-light);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.25;
}

.card-bubble p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 25px;
  font-weight: 400;
}

/* Pill-shaped colorful buttons */
.btn-pill {
  font-family: var(--title-font);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 11px 30px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-pill-red {
  background-color: var(--primary-red);
  color: white;
  box-shadow: 0 6px 0px #b00026, 0 12px 20px rgba(230, 0, 55, 0.3);
}

.btn-pill-red:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0px #b00026, 0 15px 25px rgba(230, 0, 55, 0.4);
}

.btn-pill-red:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0px #b00026;
}

.btn-pill-yellow {
  background-color: var(--secondary-yellow);
  color: var(--royal-purple);
  box-shadow: 0 6px 0px #d6af00, 0 12px 20px rgba(255, 208, 0, 0.3);
}

.btn-pill-yellow:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0px #d6af00, 0 15px 25px rgba(255, 208, 0, 0.4);
}

.btn-pill-yellow:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0px #d6af00;
}

.btn-pill-green {
  background-color: var(--tree-green);
  color: white;
  box-shadow: 0 6px 0px #5c911e, 0 12px 20px rgba(118, 183, 41, 0.3);
}

.btn-pill-green:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0px #5c911e, 0 15px 25px rgba(118, 183, 41, 0.4);
}

.btn-pill-green:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0px #5c911e;
}

/* User status / Header controls */
.user-status {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-badge {
  background-color: var(--royal-purple);
  color: white;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Form Styles inside Bubble Card */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-label {
  display: block;
  font-family: var(--title-font);
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.card-white .form-label {
  color: var(--royal-purple);
}

.form-control {
  width: 100%;
  font-family: var(--body-font);
  font-size: 1.05rem;
  padding: 12px 18px;
  border: 3px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-standard);
  color: var(--text-dark);
  background-color: white;
  outline: none;
  transition: all 0.3s;
}

.form-control:focus {
  border-color: var(--secondary-yellow);
  box-shadow: 0 0 12px rgba(255,208,0,0.4);
}

/* Role Selector Options */
.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 35px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.role-option {
  background-color: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-standard);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: white;
}

.role-option:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.15);
}

.role-option.active {
  background-color: var(--secondary-yellow);
  border-color: var(--secondary-yellow);
  transform: scale(1.08);
  color: var(--royal-purple);
}

.role-option.active .role-label {
  color: var(--royal-purple);
}

.role-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
  animation: float 4s ease-in-out infinite alternate;
}

.role-label {
  font-family: var(--title-font);
  font-weight: 700;
  color: white;
  font-size: 1rem;
}

/* Dashboard Layout styles */
.dashboard-container {
  max-width: 1300px;
  width: 95%;
  margin: 30px auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  flex: 1;
}

@media (max-width: 992px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-btn {
  padding: 16px 24px;
  border-radius: var(--radius-standard);
  background-color: white;
  border: 3px solid var(--royal-purple);
  color: var(--royal-purple);
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
  box-shadow: 0 6px 0 var(--royal-purple);
}

.sidebar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--royal-purple);
  background-color: rgba(60, 9, 77, 0.03);
}

.sidebar-btn.active {
  background-color: var(--royal-purple);
  color: white;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15);
}

/* White dashboard card */
.card-white {
  background-color: white;
  color: var(--text-dark);
  border-radius: var(--radius-bubble);
  border: 4px solid var(--royal-purple);
  padding: 40px;
  box-shadow: 0 15px 35px rgba(60, 9, 77, 0.08);
  margin-bottom: 30px;
  position: relative;
}

.card-white h3 {
  font-family: var(--title-font);
  color: var(--royal-purple);
  font-size: 1.8rem;
  margin-bottom: 20px;
}

/* Garden display elements */
.garden-card {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-color: var(--tree-green);
  text-align: center;
}

.garden-card h3 {
  color: var(--tree-green);
}

.seedling-display {
  position: relative;
  height: 240px;
  width: 100%;
  margin: 25px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pot {
  width: 140px;
  height: 60px;
  background-color: #8d6e63;
  border: 4px solid var(--royal-purple);
  border-radius: 0 0 30px 30px;
  z-index: 2;
  position: relative;
}

.pot::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -10px;
  width: 152px;
  height: 12px;
  background-color: #795548;
  border: 4px solid var(--royal-purple);
  border-radius: 6px;
}

.plant-stem {
  width: 16px;
  background-color: var(--tree-green);
  border: 4px solid var(--royal-purple);
  border-bottom: none;
  position: absolute;
  bottom: 50px;
  z-index: 1;
  transition: height 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.leaf {
  width: 38px;
  height: 24px;
  background-color: #81c784;
  border: 4px solid var(--royal-purple);
  position: absolute;
}

.leaf.left {
  left: -32px;
  transform: rotate(-25deg);
  border-radius: 50% 0 50% 50%;
}

.leaf.right {
  right: -32px;
  transform: rotate(25deg);
  border-radius: 0 50% 50% 50%;
}

.flower {
  width: 70px;
  height: 70px;
  background-color: var(--secondary-yellow);
  border: 4px solid var(--royal-purple);
  border-radius: 50%;
  position: absolute;
  top: -55px;
  left: -31px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 1.8rem;
  box-shadow: 0 0 20px rgba(255,208,0,0.7);
  animation: spinFloat 4s ease-in-out infinite;
}

/* Main Grid Widgets */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.grid-span-2 {
  grid-column: span 2;
}

.grid-span-3 {
  grid-column: span 3;
}

/* Interactive Assignment item list */
.assignment-item {
  border: 3px solid var(--royal-purple);
  border-radius: var(--radius-standard);
  padding: 22px;
  background-color: #ffffff;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}

.assignment-item:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 20px rgba(60, 9, 77, 0.06);
}

.assignment-info h4 {
  font-size: 1.25rem;
  color: var(--royal-purple);
  margin-bottom: 6px;
}

.assignment-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 0.85rem;
}

.badge-pending {
  background-color: #ffebee;
  color: var(--primary-red);
  border: 2px solid var(--primary-red);
}

.badge-completed {
  background-color: #e8f5e9;
  color: var(--tree-green);
  border: 2px solid var(--tree-green);
}

/* Leaderboard custom display */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-radius: var(--radius-standard);
  border: 3px solid var(--royal-purple);
  background-color: #fff;
}

.leaderboard-rank {
  font-size: 1.5rem;
  width: 40px;
}

.leaderboard-name {
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--royal-purple);
  flex: 1;
}

.leaderboard-score {
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-red);
}

/* Quiz modal overlays */
.quiz-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(60, 9, 77, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.quiz-card {
  max-width: 600px;
  width: 90%;
  background-color: var(--royal-purple);
  border-radius: var(--radius-bubble);
  padding: 45px;
  color: white;
  border: none;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 25px 0;
}

.quiz-option {
  border: 3px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-standard);
  padding: 16px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  background-color: rgba(255,255,255,0.06);
  transition: all 0.2s;
  color: white;
}

.quiz-option:hover {
  background-color: rgba(255,255,255,0.15);
  border-color: white;
}

.quiz-option.selected {
  background-color: var(--secondary-yellow);
  color: var(--royal-purple);
  border-color: var(--secondary-yellow);
}

/* Footer elements */
footer {
  background-color: var(--royal-purple);
  color: white;
  padding: 35px 20px;
  text-align: center;
  margin-top: auto;
  border-top: 5px solid var(--secondary-yellow);
}

footer p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

footer a {
  color: var(--secondary-yellow);
  text-decoration: underline;
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(5deg); }
}

@keyframes spinFloat {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(180deg); }
  100% { transform: translateY(0px) rotate(360deg); }
}

/* Mobile Responsiveness Rules */
@media (max-width: 768px) {
  header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .user-status {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .card-bubble {
    padding: 35px 20px;
    border-radius: 40px;
  }

  .logo-mature-container {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    border-width: 3px;
  }

  .logo-mature-container img {
    width: 40px;
    height: 40px;
  }

  .card-bubble h2 {
    font-size: 1.8rem;
  }

  .role-selector {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .role-option {
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  .role-emoji svg {
    width: 24px !important;
    height: 24px !important;
  }

  .role-emoji {
    font-size: 1.8rem;
    margin-bottom: 0;
  }

  .dashboard-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .sidebar-btn {
    width: 100%;
    text-align: center;
  }

  .card-white {
    padding: 24px;
    border-radius: 35px;
  }

  .widgets-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .grid-span-2, .grid-span-3 {
    grid-column: span 1 !important;
  }

  .quiz-card {
    padding: 25px 20px;
    border-radius: 35px;
  }

  .quiz-card h3 {
    font-size: 1.4rem;
  }

  .assignment-item {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .assignment-item button {
    width: 100%;
  }
}

/* Global Modal overlay and card styling across dashboards */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(60, 9, 77, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.modal-card {
  background-color: white;
  color: var(--text-dark);
  border-radius: 35px;
  border: 4px solid var(--royal-purple);
  padding: 35px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  position: relative;
  box-sizing: border-box;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2.2rem;
  cursor: pointer;
  color: var(--royal-purple);
  font-weight: bold;
  transition: transform 0.2s;
}

.modal-close:hover {
  transform: scale(1.2);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Screen Freeze Loading Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(60, 9, 77, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader-overlay .loader-card {
  background-color: white;
  padding: 40px;
  border-radius: var(--radius-bubble);
  border: 4px solid var(--royal-purple);
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 320px;
  width: 90%;
  box-sizing: border-box;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid var(--secondary-yellow);
  border-bottom: 6px solid var(--primary-red);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Global Table Styles */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-standard);
  border: 3px solid var(--royal-purple);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  margin: 0;
}

.admin-table th, .admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(60, 9, 77, 0.08);
  text-align: left;
}

.admin-table th {
  background-color: var(--royal-purple);
  color: white;
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 1rem;
}

.admin-table tbody tr:hover {
  background-color: rgba(60, 9, 77, 0.02);
}



