/* ============================================
   STAGE 5: TOOLBAR STYLING (UPDATED v2)
   - Huat Club branding (not Premium)
   - Simplified design without color coding
   - Clean progress bars with percentages
   styles/toolbar.css
   ============================================ */

/* ===== BASE TOOLBAR STYLES ===== */
.temple-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(145deg, var(--golden-yellow), var(--golden-yellow-light));
  border-bottom: 3px solid var(--vermillion);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  backdrop-filter: blur(5px);
}

/* Lunar calendar is now in document flow (no positioning override needed) */
/* The padding-top on .temple-interior already pushes content below toolbar */

/* Adjust lunar calendar position */
.lunar-calendar {
  top: 80px !important; /* 60px toolbar + 20px gap */
}

/* ===== LEFT SECTION: USER BUTTON ===== */
.toolbar-left {
  display: flex;
  align-items: center;
  position: relative;  /* ADD THIS */
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.toolbar-brand:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

.temple-icon {
  font-size: 1.8em;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.temple-name {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--vermillion-dark);
  text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

/* ===== CENTER SECTION: FEATURE COUNTERS (SIMPLIFIED) ===== */
.toolbar-center {
  display: flex;
  align-items: center;
  gap: 15px;
}

.feature-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.3);
  border: 2px solid rgba(220, 20, 60, 0.2);
  border-radius: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.feature-counter:hover {
  background: rgba(255,255,255,0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.counter-icon {
  font-size: 1.4em;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.counter-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.counter-label {
  font-size: 0.7em;
  font-weight: bold;
  color: var(--deep-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.counter-value {
  font-size: 0.9em;
  font-weight: bold;
  color: var(--vermillion-dark);
}

/* REMOVED: Color-based states - now all counters look the same */

/* ===== RIGHT SECTION: USER MENU ===== */
.toolbar-right {
  display: flex;
  align-items: center;
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.3);
  border: 2px solid var(--vermillion);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Georgia', serif;
  font-weight: bold;
  color: var(--deep-red);
}

.user-menu-btn:hover {
  background: rgba(255,255,255,0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Login/Sign Up Button */
.login-signup-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--vermillion);
  border: 2px solid var(--golden-yellow);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Georgia', serif;
  font-weight: bold;
  color: var(--golden-yellow);
  box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.login-signup-btn:hover {
  background: var(--golden-yellow);
  color: var(--vermillion);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 20, 60, 0.4);
}

.login-signup-btn .auth-icon {
  font-size: 1.3em;
}

.login-signup-btn .auth-text {
  font-size: 0.95em;
  white-space: nowrap;
}

.user-icon {
  font-size: 1.3em;
}

.user-name {
  font-size: 0.9em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* UPDATED: Huat Club badge styling */
.user-badge {
  font-size: 0.7em;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--vermillion);
  color: var(--golden-yellow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-badge.huat-club {
  background: linear-gradient(135deg, var(--golden-yellow-dark), var(--orange));
  color: var(--deep-red);
  box-shadow: 0 2px 4px rgba(255,215,0,0.3);
}

.dropdown-arrow {
  font-size: 0.8em;
  transition: transform 0.3s ease;
}

.user-menu-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* ===== USER DROPDOWN MENU (DESKTOP) ===== */
.user-dropdown {
  position: absolute;
  top: 100%;
  left: 0; /*<- CHANGED ->*/
  background: var(--ivory);
  border: 2px solid var(--vermillion);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  min-width: 280px;
  margin-top: 10px;
  z-index: 101;
  animation: dropdownFadeIn 0.3s ease;
}

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

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: linear-gradient(145deg, var(--golden-yellow-light), var(--ivory));
  border-radius: 10px 10px 0 0;
}

.user-avatar {
  font-size: 2.5em;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  border: 2px solid var(--vermillion);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name-full {
  font-size: 1em;
  font-weight: bold;
  color: var(--deep-red);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email {
  font-size: 0.8em;
  color: var(--burgundy);
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-divider {
  height: 1px;
  background: var(--vermillion);
  opacity: 0.2;
  margin: 8px 0;
}

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

.dropdown-section-title {
  font-size: 0.75em;
  font-weight: bold;
  color: var(--vermillion-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.dropdown-item,
.dropdown-item-static {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Georgia', serif;
  font-size: 0.9em;
  color: var(--deep-red);
}

.dropdown-item:hover {
  background: rgba(220, 20, 60, 0.1);
  transform: translateX(4px);
}

.dropdown-item-static {
  cursor: default;
  font-weight: 500;
  justify-content: space-between;
}

.dropdown-item-static:hover {
  background: transparent;
  transform: none;
}

.dropdown-value {
  font-weight: bold;
  color: var(--vermillion-dark);
}

.merit-display {
  background: linear-gradient(145deg, rgba(255,215,0,0.1), rgba(255,165,0,0.1));
  border-radius: 8px;
  padding: 12px 15px !important;
  margin: 8px;
}

.merit-value {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--golden-yellow-dark);
}

/* ===== MOBILE MENU BUTTON ===== */
.mobile-menu-btn {
  display: none; /* Hidden on desktop */
  background: rgba(255,255,255,0.3);
  border: 2px solid var(--vermillion);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
  background: rgba(255,255,255,0.5);
  transform: scale(1.05);
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
}

.hamburger-icon span {
  display: block;
  height: 3px;
  background: var(--vermillion);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== MOBILE MENU PANEL ===== */
.mobile-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--vermillion-dark);
  z-index: 200;
  overflow-y: auto;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: linear-gradient(145deg, var(--golden-yellow), var(--golden-yellow-light));
  border-bottom: 3px solid var(--vermillion);
}

.mobile-menu-title {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--vermillion-dark);
  margin: 0;
}

.mobile-menu-close {
  font-size: 2em;
  background: transparent;
  border: none;
  color: var(--vermillion);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mobile-menu-close:hover {
  background: rgba(220, 20, 60, 0.1);
  transform: rotate(90deg);
}

.mobile-menu-content {
  padding: 20px;
}

/* Mobile User Section */
.mobile-user-section {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: linear-gradient(145deg, var(--golden-yellow), var(--golden-yellow-light));
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.mobile-user-avatar {
  font-size: 3em;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  border: 3px solid var(--vermillion);
}

.mobile-user-info {
  flex: 1;
  min-width: 0;
}

.mobile-user-name {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--deep-red);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.mobile-user-email {
  font-size: 0.85em;
  color: var(--burgundy);
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}

.mobile-user-badge-container {
  margin-top: 8px;
}

/* UPDATED: Huat Club mobile badge */
.mobile-user-badge {
  display: inline-block;
  font-size: 0.75em;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--vermillion);
  color: var(--golden-yellow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: bold;
}

.mobile-user-badge.huat-club {
  background: linear-gradient(135deg, var(--golden-yellow-dark), var(--orange));
  color: var(--deep-red);
}

/* Mobile Sections */
.mobile-section {
  margin-bottom: 25px;
}

.mobile-section-title {
  font-size: 0.85em;
  font-weight: bold;
  color: var(--golden-yellow);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  padding-left: 5px;
}

/* Mobile Feature Items (SIMPLIFIED) */
.mobile-feature-item {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,215,0,0.2);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 12px;
}

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

.mobile-feature-icon {
  font-size: 1.5em;
}

.mobile-feature-label {
  font-size: 1em;
  font-weight: bold;
  color: var(--ivory);
}

.mobile-feature-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

/* SIMPLIFIED: Single color progress bar */
.progress-bar {
  flex: 1;
  height: 20px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--golden-yellow), var(--orange));
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.progress-text {
  font-size: 0.9em;
  font-weight: bold;
  color: var(--golden-yellow);
  min-width: 50px;
  text-align: right;
}

/* NEW: Progress percentage display */
.progress-percentage {
  font-size: 0.85em;
  color: var(--golden-yellow-light);
  text-align: right;
  margin-top: 2px;
  font-weight: 500;
}

.mobile-feature-status {
  margin-top: 8px;
}

/* UPDATED: Huat Club status badge */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85em;
  font-weight: bold;
}

.status-badge.huat-club {
  background: linear-gradient(135deg, var(--golden-yellow-dark), var(--orange));
  color: var(--deep-red);
}

/* Mobile Merit Display */
.mobile-merit-display {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: linear-gradient(145deg, rgba(255,215,0,0.15), rgba(255,165,0,0.1));
  border: 2px solid var(--golden-yellow);
  border-radius: 12px;
}

.mobile-merit-icon {
  font-size: 2.5em;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.mobile-merit-info {
  flex: 1;
}

.mobile-merit-label {
  display: block;
  font-size: 0.85em;
  font-weight: bold;
  color: var(--golden-yellow-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.mobile-merit-value {
  display: block;
  font-size: 1.8em;
  font-weight: bold;
  color: var(--golden-yellow);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Mobile Menu Items */
.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,215,0,0.2);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Georgia', serif;
  font-size: 1em;
  color: var(--ivory);
  font-weight: bold;
  width: 100%;
  text-align: left;
}

.mobile-menu-item:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,215,0,0.4);
  transform: translateX(5px);
}

.mobile-item-icon {
  font-size: 1.5em;
}

.mobile-item-label {
  flex: 1;
}

.mobile-item-arrow {
  font-size: 1.3em;
  color: var(--golden-yellow);
}

.mobile-menu-item.danger {
  border-color: rgba(220, 20, 60, 0.3);
}

.mobile-menu-item.danger:hover {
  background: rgba(220, 20, 60, 0.1);
  border-color: rgba(220, 20, 60, 0.5);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet and below: Show mobile menu */
@media screen and (max-width: 767px) {
  .toolbar-center {
    display: none; /* Hide feature counters */
  }
  
  .mobile-menu-btn {
    display: flex; /* Show hamburger */
  }
  
  .user-menu-btn .user-name,
  .user-menu-btn .user-badge,
  .user-menu-btn .dropdown-arrow {
    display: none; /* Hide text, show only icon */
  }
  
  .temple-name {
    display: none; /* Hide temple name on very small screens */
  }
}

/* Small mobile optimization */
@media screen and (max-width: 479px) {
  .temple-toolbar {
    padding: 0 15px;
    height: 55px;
  }
  
  .temple-interior {
    padding-top: 55px !important;
  }
  
  .lunar-calendar {
    top: 75px !important;
  }
  
  .temple-icon {
    font-size: 1.5em;
  }
  
  .user-menu-btn {
    padding: 8px 10px;
  }
  
  .mobile-menu-btn {
    padding: 8px 10px;
  }
}

/* Desktop: Hide mobile elements */
@media screen and (min-width: 768px) {
  .mobile-menu-btn {
    display: none !important;
  }
  
  .mobile-menu-panel {
    display: none !important;
  }
}

/* Large desktop: More spacing */
@media screen and (min-width: 1440px) {
  .temple-toolbar {
    padding: 0 40px;
  }
  
  .toolbar-center {
    gap: 20px;
  }
  
  .feature-counter {
    padding: 10px 18px;
  }
}

/* ===== END OF TOOLBAR STYLING (v2) ===== */
