/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 *
 *= require_self
 *= require memberships
 */

/* Sidebar Menu Styling */
.sidebar-menu {
  background-color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  min-width: 250px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

.sidebar-menu.open {
  transform: translateX(0);
}

.sidebar-menu .header {
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-menu .header h1 {
  color: #4f46e5;
  font-weight: 700;
  font-size: 1.25rem;
}

.sidebar-menu .close-button {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
}

.sidebar-menu .menu-items {
  padding: 1rem 0;
}

.sidebar-menu .menu-item {
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  min-height: 48px;
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}

.sidebar-menu .menu-item:hover {
  background-color: #f3f4f6;
  color: #4f46e5;
}

.sidebar-menu .menu-item.active {
  background-color: #eff6ff;
  color: #4f46e5;
  border-left: 3px solid #4f46e5;
  font-weight: 600;
  position: relative;
  padding-left: calc(1.5rem - 3px); /* Adjust for the border */
}

.sidebar-menu .menu-item.active::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #4f46e5;
}

.sidebar-menu .user-info {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
}

.sidebar-menu .user-email {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.sidebar-menu .menu-footer {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Overlay for mobile */
.sidebar-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
  display: none;
}

.sidebar-overlay.open {
  display: block;
}

/* Fix for main navigation */
.top-nav-links {
  display: flex;
  align-items: center;
  height: 100%;
}

.top-nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Enhanced top navigation bar */
.main-navbar {
  height: 64px !important;
  background: linear-gradient(90deg, #4338ca, #6366f1) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
}

.main-navbar .navbar-brand {
  font-size: 1.25rem !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  height: 100%;
}

.main-navbar .navbar-brand img {
  max-height: 32px;
  width: auto;
}

.main-navbar .top-nav-links {
  height: 100%;
  display: flex;
  align-items: center;
}

.main-navbar .top-nav-links .nav-link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 36px !important;
  margin: 0 4px !important;
  padding: 0 12px !important;
  line-height: 36px !important;
  font-size: 0.875rem !important;
}

.main-navbar .nav-link {
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
}

.main-navbar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.375rem;
}

.main-navbar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2) !important;
  font-weight: 600 !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.main-navbar .nav-link.active::after {
  content: '' !important;
  position: absolute !important;
  bottom: 6px !important;
  left: 25% !important;
  width: 50% !important;
  height: 3px !important; /* Slightly thicker for better visibility */
  background-color: white !important;
  border-radius: 1px !important;
}

/* Make footer always stay at bottom */
html, body {
  height: 100%;
  margin: 0;
}

/* Page container that will push footer to bottom */
.page-container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Push footer to bottom with flex */
main {
  flex: 1;
}

/* Footer styling improvements */
.app-footer {
  background-color: #f9fafb;
  padding: 2rem 0;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
}

.app-footer .footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-footer .footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.app-footer .copyright {
  color: #6b7280;
  font-size: 0.875rem;
}

.app-footer .social-links {
  display: flex;
  gap: 1rem;
}

.app-footer .social-link {
  color: #6b7280;
  transition: color 0.2s;
}

.app-footer .social-link:hover {
  color: #4f46e5;
}

/* User avatar & member initials fix */
.user-avatar, .member-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

#user-menu-button:hover .user-avatar {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  font-weight: 600;
  text-transform: uppercase;
}

/* Member circle improvements */
.member-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4f46e5;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

/* Fix dropdown visibility */
.dropdown-menu {
  z-index: 50 !important;
  position: absolute !important;
  overflow: visible !important;
}

.dropdown-menu[style*="display: none"] {
  display: none !important;
}

/* Dropdown menu items */
.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: #4b5563;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.dropdown-menu a:hover {
  background-color: #f3f4f6;
  color: #4f46e5;
}

/* Screen reader only text - visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (min-width: 768px) {
  .md\:block {
    display: block !important;
  }
  
  .md\:flex {
    display: flex !important;
  }
  
  .md\:hidden {
    display: none !important;
  }
}

/* Browser cache buster - change slightly each time */
.nav-force-update-20231024 {
  display: none;
}

/* User profile edit page styling */
.edit-user-container {
  max-width: 560px;
  margin: 0 auto;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 2rem;
}

.edit-user-container h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.edit-user-container .field {
  margin-bottom: 1.25rem;
}

.edit-user-container label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #374151;
}

.edit-user-container em {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.edit-user-container input[type="email"],
.edit-user-container input[type="password"],
.edit-user-container input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: #f9fafb;
  color: #1f2937;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.edit-user-container input[type="email"]:focus,
.edit-user-container input[type="password"]:focus,
.edit-user-container input[type="text"]:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  outline: none;
}

.edit-user-container .actions {
  margin-top: 2rem;
}

.edit-user-container input[type="submit"] {
  background-color: #4f46e5;
  color: white;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.edit-user-container input[type="submit"]:hover {
  background-color: #4338ca;
}

.edit-user-links {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.edit-user-links .danger-zone {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid #ef4444;
  border-radius: 0.375rem;
  background-color: rgba(239, 68, 68, 0.05);
}

.edit-user-links .danger-zone h3 {
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.edit-user-links a {
  display: inline-block;
  margin-top: 0.5rem;
  color: #4f46e5;
  text-decoration: none;
  transition: color 0.2s;
}

.edit-user-links a:hover {
  color: #4338ca;
  text-decoration: underline;
}

.edit-user-links .cancel-account {
  color: #ef4444;
  background-color: transparent;
  border: 1px solid #ef4444;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
  display: inline-block;
}

.edit-user-links .cancel-account:hover {
  color: white;
  background-color: #ef4444;
}

.edit-user-links .back-link {
  display: inline-flex;
  align-items: center;
  margin-top: 1.5rem;
  color: #6b7280;
}

.edit-user-links .back-link:hover {
  color: #4f46e5;
}

.edit-user-links .back-link svg {
  margin-right: 0.375rem;
  height: 0.875rem;
  width: 0.875rem;
}

/* Alert styling */
.alert-info {
  background-color: #eff6ff;
  color: #1e40af;
  padding: 0.75rem 1rem;
  border-left: 4px solid #3b82f6;
  border-radius: 0.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* Star Rating Styles */
.rating-label svg {
  cursor: pointer;
  transition: color 0.2s;
}

.rating-label:hover svg,
.rating-label:hover ~ .rating-label svg {
  color: #FBBF24 !important;
}

.peer:checked ~ .rating-label svg {
  color: #FBBF24 !important;
}

/* User profile dropdown */
.user-profile-dropdown {
  display: flex;
  align-items: center;
  height: 100%;
}

.user-profile-dropdown button {
  height: 44px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.user-profile-dropdown button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.user-profile-dropdown .user-avatar {
  height: 30px;
  width: 30px;
  min-height: 30px;
  min-width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #4338ca;
  margin-right: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-profile-dropdown .avatar-initial {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
}

/* Dropdown menu styles */
.user-profile-dropdown .dropdown-menu,
.user-profile-dropdown [x-show="open"] {
  width: 160px !important;
  font-size: 0.7rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50 !important;
  position: absolute !important;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  overflow: visible !important;
}

.user-profile-dropdown .dropdown-menu .py-0.5,
.user-profile-dropdown [x-show="open"] .py-0.5 {
  padding-top: 1px;
  padding-bottom: 1px;
}

.user-profile-dropdown .dropdown-menu .px-2,
.user-profile-dropdown [x-show="open"] .px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.user-profile-dropdown .dropdown-menu .py-1,
.user-profile-dropdown [x-show="open"] .py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.user-profile-dropdown .dropdown-menu svg,
.user-profile-dropdown [x-show="open"] svg {
  height: 0.65rem;
  width: 0.65rem;
  margin-right: 0.35rem;
}

/* Fix for button_to styling in memberships */
.whitespace-nowrap form {
  display: inline-block;
}

.whitespace-nowrap button[type="submit"] {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.whitespace-nowrap button[type="submit"].flex {
  display: flex;
  align-items: center;
}

.menu-text {
  display: inline !important;
}

/* Timeline styling fixes */
.timeline-container {
  position: relative;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8px;
  width: 3px;
  background-color: #818cf8;
  border-radius: 9999px;
  z-index: 1;
}

.date-circle {
  position: relative;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #4f46e5;
  color: white;
  border-radius: 50%;
  font-weight: bold;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 2px solid white;
}

.activity-dot {
  position: absolute;
  left: -12px;
  top: 8px;
  width: 16px;
  height: 16px;
  background-color: white;
  border: 2px solid #4f46e5;
  border-radius: 50%;
  z-index: 10;
}

.timeline-activities {
  margin-left: 32px;
  padding-left: 32px;
}

.timeline-activity {
  position: relative;
  margin-bottom: 24px;
}

.timeline-activity-card {
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  background-color: white;
  transition: box-shadow 0.2s;
}

.timeline-activity-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}