/* static/css/style.css */

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Work Sans', Arial, sans-serif;
  background-color: #f9f9f9;
  padding-top: 60px; /* Espacio para compensar el header fijo */
  min-height: 100vh;
}

body::-webkit-scrollbar{
  display: none;
}

/* Barra de navegación */
.navbar {
  background-color: #4CAF50;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo {
  display: flex;
  align-items: center;
  height: 60px;
}

.logo img {
  width: 45px;
  height: 45px;
  margin-right: 12px;
  display: block;
}

.logo a {
  text-decoration: none;
  color: #fff;
  font-size: 1.8em;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  height: 60px;
}

/* Navegación de escritorio */
.desktop-nav {
  display: flex;
  align-items: center;
}

.desktop-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
  align-items: center;
}

.desktop-nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.desktop-nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Botón hamburguesa */
.hamburger {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 2000;
  position: relative;
  transition: transform 0.3s ease;
  width: 44px;
  height: 44px;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border-radius: 4px;
  flex-shrink: 0;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hamburger:focus {
  outline: none;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: #fff;
  margin: 5px auto;
  transition: all 0.3s ease;
  border-radius: 3px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Estilo para asegurar que el botón hamburguesa sea visible en móviles */
@media (max-width: 768px) {
  .hamburger {
    display: block !important;
  }
  
  .desktop-nav {
    display: none !important;
  }
}

/* Menú lateral (sidebar) */
.sidebar {
  position: fixed;
  top: 60px;
  right: -100%;
  background-color: #4CAF50;
  color: #fff;
  padding: 1.5rem;
  border-radius: 0 0 0 12px;
  box-shadow: -2px 2px 10px rgba(0,0,0,0.1);
  z-index: 999;
  width: 280px;
  transition: right 0.3s ease;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  height: auto;
  transform: translateX(0);
}

.sidebar.active {
  right: 0;
  transform: translateX(0);
}

.sidebar ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.sidebar ul li {
  width: 100%;
  text-align: center;
}

.sidebar ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar ul li a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateX(-5px);
}

.sidebar ul li a i {
  font-size: 1.2em;
}

.sidebar-user-info {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin: 0;
  padding: 0.4rem 0;
}

.sidebar-user-info a {
  font-weight: 600;
  padding: 0.6rem 1rem;
}

.sidebar-user-info a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateX(-3px);
}

/* Contenedor principal (main) */
main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Responsivo */
@media (max-width: 768px) {
  body {
    padding-top: 60px;
  }
  
  .desktop-nav {
    display: none !important;
  }

  .hamburger {
    display: block !important;
  }

  .logo a {
    font-size: 1.5em;
  }

  .logo img {
    width: 38px;
    height: 38px;
  }

  main {
    padding: 15px;
    max-width: 100%;
  }
  
  body.menu-open {
    overflow: hidden;
  }
  
  .sidebar {
    width: 280px;
    padding: 1.2rem;
  }
  
  .navbar {
    padding: 0 15px;
  }
  
  .navbar-right {
    gap: 0.3rem;
  }
  
  .user-info-header,
  .logout-icon-header {
    display: none;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0 15px;
  }

  .logo a {
    font-size: 1.3em;
  }

  .logo img {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }

  .sidebar {
    width: 100%;
    border-radius: 0;
    padding: 1rem;
  }
  
  .hamburger {
    width: 40px;
    height: 40px;
    padding: 6px;
  }
  
  .hamburger span {
    width: 24px;
  }
}

/* Overlay para el menú móvil */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.user-info-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.user-info-header a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.user-info-header:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.user-info-header .fa-user-circle {
  color: #fff;
  font-size: 1.2rem;
}

.user-info-header .user-name {
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
  max-width: 150px;
}

.header-user-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logout-icon-header {
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

.logout-icon-header:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .user-info-header,
  .logout-icon-header {
    display: none;
  }
}

.navbar-right {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 0.5rem;
  flex-shrink: 0;
}
