/**
 * Profile Dropdown Fix
 * Fixes white border blocking icons and ensures proper display across all devices
 * Version: 1.0.0 (2025-11-11)
 */

/* User Dropdown Container */
.user-dropdown {
  position: relative;
  z-index: 1000;
}

/* User Button */
.user-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: inherit;
}

.user-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* User Avatar */
.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #673AB7, #9C27B0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.user-avatar i {
  font-size: 20px;
}

/* User Name */
#user-name {
  font-weight: 500;
  font-size: 14px;
  color: inherit;
}

/* Dropdown Arrow */
.user-button .material-icons:last-child {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.user-button.active .material-icons:last-child {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1001;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

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

/* Dropdown Items */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.dropdown-item:hover {
  background: rgba(103, 58, 183, 0.08);
  color: #673AB7;
}

.dropdown-item i {
  font-size: 20px;
  color: inherit;
}

.dropdown-item span {
  flex: 1;
  color: inherit;
}

/* Dropdown Divider */
.dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 8px 0;
}

/* Logout Item Special Styling */
#logout-menu-btn {
  color: #dc3545;
}

#logout-menu-btn:hover {
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
  }
  
  .user-button {
    padding: 6px 12px;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
  }
  
  .user-avatar i {
    font-size: 18px;
  }
  
  #user-name {
    font-size: 13px;
  }
  
  .dropdown-item {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .dropdown-item i {
    font-size: 18px;
  }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
  .dropdown-menu {
    min-width: 190px;
  }
}

/* Ensure dropdown doesn't block other elements */
.user-dropdown .dropdown-menu {
  pointer-events: none;
}

.user-dropdown .dropdown-menu.active {
  pointer-events: auto;
}

/* Fix for dark mode dashboards */
.admin-interface .dropdown-menu,
.owner-interface .dropdown-menu,
.manager-interface .dropdown-menu,
.waiter-interface .dropdown-menu {
  background: white;
  color: #333;
}

.admin-interface .dropdown-item,
.owner-interface .dropdown-item,
.manager-interface .dropdown-item,
.waiter-interface .dropdown-item {
  color: #333;
}

.admin-interface .dropdown-item:hover,
.owner-interface .dropdown-item:hover,
.manager-interface .dropdown-item:hover,
.waiter-interface .dropdown-item:hover {
  background: rgba(103, 58, 183, 0.08);
  color: #673AB7;
}

/* Ensure icons are visible */
.dropdown-item i.material-icons {
  opacity: 1;
  visibility: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Remove any conflicting white borders */
.user-button,
.dropdown-menu,
.dropdown-item {
  border: none !important;
  outline: none !important;
}

.dropdown-menu {
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

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

.dropdown-menu.active {
  animation: dropdownFadeIn 0.3s ease;
}
