/* Estilos para el header y la barra lateral */

/* Header */
.header {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 40px;
  margin-right: 10px;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: #4caf50;
  margin: 0;
}

.main-nav {
  display: flex;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-link:hover {
  color: #4caf50;
}

.nav-link.active {
  color: #4caf50;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 15px;
  right: 15px;
  height: 3px;
  background-color: #4caf50;
  border-radius: 3px 3px 0 0;
}

/* Botones de autenticación */
.auth-buttons {
  display: flex;
  gap: 10px;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

.login-btn {
  background-color: transparent;
  color: #4caf50;
  border: 1px solid #4caf50;
}

.login-btn:hover {
  background-color: rgba(76, 175, 80, 0.1);
}

.register-btn {
  background-color: #4caf50;
  color: white;
  border: 1px solid #4caf50;
}

.register-btn:hover {
  background-color: #43a047;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.auth-btn i {
  margin-right: 8px;
}

/* Menú de usuario */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
  background-color: #f5f5f5;
}

.user-menu-btn:hover {
  background-color: #e0e0e0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #4caf50;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-btn i {
  font-size: 12px;
  color: #666;
  transition: transform 0.3s;
}

.user-menu-btn:hover i {
  transform: translateY(2px);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  z-index: 1000;
  overflow: hidden;
  display: none;
  animation: fadeInDown 0.3s ease;
  transform-origin: top right;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.user-dropdown a:hover {
  background-color: #f5f5f5;
  padding-left: 20px;
}

.user-dropdown i {
  font-size: 16px;
  color: #4caf50;
  width: 20px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background-color: #eee;
  margin: 8px 0;
}

.logout-btn {
  color: #f44336 !important;
}

.logout-btn i {
  color: #f44336 !important;
}

/* Botón de menú para móviles */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: #4caf50;
  cursor: pointer;
}

/* Barra lateral para móviles */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background-color: white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  overflow-y: auto;
  transition: left 0.3s ease;
}

.sidebar.show {
  left: 0;
}

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

.sidebar-header h2 {
  margin: 0;
  color: #4caf50;
  font-size: 20px;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
}

.sidebar-nav {
  padding: 20px 0;
}

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s;
}

.sidebar-nav-link:hover {
  background-color: #f5f5f5;
  color: #4caf50;
}

.sidebar-nav-link.active {
  background-color: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border-left: 3px solid #4caf50;
}

.sidebar-nav-link i {
  margin-right: 15px;
  width: 20px;
  text-align: center;
  color: #4caf50;
}

.sidebar-divider {
  height: 1px;
  background-color: #eee;
  margin: 10px 0;
}

.sidebar-auth {
  padding: 20px;
}

.sidebar-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-auth-buttons .auth-btn {
  width: 100%;
  justify-content: center;
}

/* Información de usuario en la barra lateral */
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #4caf50;
  margin-bottom: 15px;
}

.sidebar-username {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 5px;
  color: #333;
}

.sidebar-role {
  font-size: 14px;
  color: #666;
  margin: 0 0 20px;
}

.sidebar-user-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-radius: 8px;
  background-color: #f5f5f5;
  color: #333;
  text-decoration: none;
  transition: all 0.3s;
}

.sidebar-user-btn:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.sidebar-user-btn i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
  color: #4caf50;
}

.sidebar-user-btn.logout {
  background-color: rgba(244, 67, 54, 0.1);
}

.sidebar-user-btn.logout i {
  color: #f44336;
}

.sidebar-user-btn.logout:hover {
  background-color: rgba(244, 67, 54, 0.2);
}

/* Overlay para la barra lateral */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* Animaciones */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive */
@media (max-width: 992px) {
  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .auth-buttons .auth-btn span {
    display: none;
  }

  .auth-buttons .auth-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-buttons .auth-btn i {
    margin-right: 0;
  }

  .user-name {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 15px;
  }

  .logo-text {
    font-size: 20px;
  }

  .auth-buttons {
    gap: 5px;
  }
}
