/* Variables de colores */
:root {
  --color-primary: #3a86ff;
  --color-secondary: #ff006e;
  --color-accent: #387960;
  --color-dark: #2b2d42;
  --color-light: #f8f9fa;
  --color-gray: #6c757d;
  --color-success: #38b000;
  --color-info: #00b4d8;
  --color-warning: #ffbe0b;
  --color-danger: #d90429;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

/* Estilos generales */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f7fa;
  color: var(--color-dark);
  line-height: 1.6;
}

/* Cabecera */
header {
  background: linear-gradient(135deg, #8bc8e9, #135624);
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: white;
  display: flex;
  align-items: center;
}

.logo-icon {
  margin-right: 10px;
  font-size: 2rem;
  max-width: 100px;
  width: 50%;
  max-height: 100px;
  height: 50%;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}


nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  transition: var(--transition);
}

nav ul li a:hover, nav ul li a.active {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Contenido principal */
.main-container {
  display: flex;
  flex: 1;
  position: relative;
  z-index: 1;
}

.content {
  background-color: #f5f7fa;
  flex: 1;
  padding: 2rem;
  min-height: calc(100vh - 85px);
}

.content h1 {
  margin-bottom: 2rem;
  color: var(--color-dark);
  font-weight: 700;
  font-size: 2rem;
  position: relative;
  display: inline-block;
}

.content h1::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 70px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}


/* Pie de página - mismo comportamiento que header */
footer {
  background: linear-gradient(135deg, #387960, #135624);
  color: white;
  padding: 2rem;
  position: relative;
  z-index: 0;
}

footer p {
  font-weight: 500;
  display: flex;
  align-items: center;
  margin: 0;
  /* Sin max-width ni margin auto para que se ajuste al borde */
}

footer p i {
  margin-right: 8px;
}


@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1rem;
  }

  nav ul {
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  .main-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    padding: 1.5rem;
  }
  
  .content {
    padding: 1.5rem;
    min-height: auto;
  }
  
  .article-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
  }
  
  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
  
  .content h1 {
    font-size: 1.75rem;
  }
  
  .button-group {
    flex-direction: row;
  }
  
  .edit-btn {
    width: 38px;
    height: 38px;
  }
  
  .article-btn {
    padding: 0.7rem 1rem;
  }
}