/* ========== USER MENU DROPDOWN - SHARED STYLES ========== */
/* CRITICAL: Override style.css .user-menu { display: none } */

/* User Menu Container */
.user-menu {
  position: relative;
  margin-left: auto; /* Always push to right */
  display: flex !important; /* Override style.css line 1149 */
  flex-direction: row !important;
  background: transparent !important;
  box-shadow: none !important;
  min-width: auto !important;
  top: auto !important;
  right: auto !important;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
}

.user-menu-trigger:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(220,38,38,0.3);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  line-height: 1.2;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  line-height: 1;
}

.user-role {
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  margin-top: 0.15rem;
}

.user-role::before {
  content: attr(data-icon);
  font-size: 0.55rem;
}

/* Free/Visitor - Simple gray */
.user-role.tier-free,
.user-role:not([class*="tier-"]) {
  color: #94a3b8;
  background: rgba(100,116,139,0.15);
  border: 1px solid rgba(100,116,139,0.2);
}

/* Starter - Blue */
.user-role.tier-starter {
  color: #60a5fa;
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(99,102,241,0.1));
  border: 1px solid rgba(59,130,246,0.3);
}

/* Full/Pro - Purple */
.user-role.tier-pro,
.user-role.tier-full {
  color: #a78bfa;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(167,139,250,0.1));
  border: 1px solid rgba(139,92,246,0.3);
}

/* Elite - Gold with crown */
.user-role.tier-elite {
  color: #fbbf24;
  background: linear-gradient(135deg, rgba(234,179,8,0.2), rgba(251,191,36,0.15));
  border: 1px solid rgba(234,179,8,0.4);
  box-shadow: 0 0 10px rgba(234,179,8,0.2);
}

/* Coach - Red premium */
.user-role.tier-coach {
  color: #f87171;
  background: linear-gradient(135deg, rgba(220,38,38,0.2), rgba(239,68,68,0.15));
  border: 1px solid rgba(220,38,38,0.4);
  box-shadow: 0 0 10px rgba(220,38,38,0.15);
}

/* Student - Green */
.user-role.tier-student {
  color: #4ade80;
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(74,222,128,0.1));
  border: 1px solid rgba(34,197,94,0.3);
}

.user-menu-trigger i.fa-chevron-down {
  font-size: 0.7rem;
  color: #64748b;
  transition: transform 0.3s;
}

.user-menu.open .user-menu-trigger i.fa-chevron-down {
  transform: rotate(180deg);
}

/* Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: linear-gradient(135deg, rgba(30,41,59,0.98), rgba(15,23,42,0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 1001;
}

.user-menu.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dropdown-header .user-avatar {
  width: 45px;
  height: 45px;
  font-size: 1rem;
}

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

.dropdown-header .user-name {
  font-size: 0.95rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-header .user-email {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.15rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-section {
  padding: 0.25rem 0;
}

.dropdown-section-title {
  font-size: 0.65rem;
  color: #64748b !important;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  letter-spacing: 0.5px;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  color: #cbd5e1 !important; /* Override style.css .user-menu a color */
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.dropdown-link:hover {
  background: rgba(220,38,38,0.1);
  color: #fff !important;
}

.dropdown-link i {
  width: 18px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

.dropdown-link:hover i {
  color: #dc2626;
}

.dropdown-link .notif-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.dropdown-link.logout {
  color: #f87171 !important;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 0.5rem;
  padding-top: 0.85rem;
}

.dropdown-link.logout:hover {
  background: rgba(239,68,68,0.1);
  color: #ff8a8a !important;
}

.dropdown-link.logout i {
  color: #f87171;
}

/* Header buttons */
.header-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  font-size: 0.9rem;
}

.header-btn:hover {
  background: rgba(220,38,38,0.1);
  border-color: rgba(220,38,38,0.3);
  color: #dc2626;
  transform: translateY(-2px);
}

/* Role Badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

.user-badge.tier-free {
  background: rgba(100,116,139,0.15);
  border: 1px solid rgba(100,116,139,0.3);
  color: #94a3b8;
}

.user-badge.tier-pro {
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(99,102,241,0.15));
  border: 1px solid rgba(59,130,246,0.4);
  color: #60a5fa;
  box-shadow: 0 0 20px rgba(59,130,246,0.15);
}

.user-badge.tier-elite {
  background: linear-gradient(135deg, rgba(234,179,8,0.2), rgba(251,191,36,0.15));
  border: 1px solid rgba(234,179,8,0.4);
  color: #fbbf24;
  box-shadow: 0 0 20px rgba(234,179,8,0.2);
  animation: elite-pulse 2s ease-in-out infinite;
}

@keyframes elite-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(234,179,8,0.2); }
  50% { box-shadow: 0 0 30px rgba(234,179,8,0.35); }
}

/* ========== MOBILE: HIDE DESKTOP USER MENU ========== */
@media (max-width: 768px) {
  /* Hide entire user menu on mobile - use mobile drawer instead */
  .user-menu {
    display: none !important;
  }
  
  /* Also hide sidebar nav row on mobile for sidebar pages */
  .sidebar-nav-row {
    display: none !important;
  }
  
  .header-btn {
    width: 38px;
    height: 38px;
  }
}

/* ========== DESKTOP: ENSURE USER MENU SHOWS ========== */
@media (min-width: 769px) {
  .user-menu {
    display: flex !important;
  }
}
