/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease-in-out;
}

body, html {
  font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
  background-color: #f8f9fa;
  color: #2b2b2b;
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* ===== TYPOGRAPHY ===== */
h2, h3 {
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2.5rem;
  color: #333;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #6e1893, #9a4ede);
}

p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1rem;
}

/* ===== HEADER & NAVIGATION ===== */
.cabecera {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  margin-bottom: 0;
}

#img {
  width: 12%;
  max-width: 120px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.5s ease;
}

#img:hover {
  transform: scale(1.05);
}

nav {
  background: linear-gradient(135deg, #212529 0%, #343a40 100%);
  display: flex;
  align-items: center;
  padding: 1rem 2rem;
  border: none;
  border-radius: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

nav ul li a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background-color: rgba(255,255,255,0.2);
  transition: height 0.3s ease;
  z-index: -1;
  border-radius: 8px;
}

nav ul li a:hover {
  background-color: transparent;
}

nav ul li a:hover::before {
  height: 100%;
}

nav ul li a .material-symbols-outlined {
  font-size: 1.4rem;
  vertical-align: middle;
}

/* ===== MAIN MENU ICONS ===== */
.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 0 0 30px 30px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.menu a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 180px;
  height: 180px;
  margin: 1rem;
  background-color: white;
  color: #333;
  font-size: 18px;
  text-decoration: none;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu a::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.03);
  top: 100%;
  left: 0;
  transition: all 0.5s ease;
  z-index: 1;
}

.menu a:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 15px 30px rgba(0,0,0,0.12);
  border-radius: 25px;
}

.menu a:hover::before {
  top: 0;
}

/* Individual menu item styles */
#mate, #fisica, #ciencias, #quimica, #lab, #games, #teAyudo {
  background-size: 80%;
  background-position: center;
  transition: all 0.5s ease;
}

#mate:hover, #fisica:hover, #ciencias:hover, #quimica:hover, #lab:hover, #games:hover, #teAyudo:hover {
  background-size: 85%;
}

/* ===== CONTENIDO SECTION ===== */
.contenido {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
  animation: fadeIn 1.2s ease-in-out;
}

.contenido h2 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #212529,rgb(138, 0, 197));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.contenido p {
  font-size: 1.4rem;
  color: #6c757d;
  margin-bottom: 3rem;
  font-weight: 300;
}

/* ===== SOCIAL ICONS ===== */
.social-icons {
  text-align: center;
  padding: 2rem 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 30px;
  margin: 2rem auto;
  max-width: 800px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.social-icons a {
  margin: 0 1rem;
  font-size: 2.2rem;
  display: inline-block;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-icons a:hover {
  transform: translateY(-5px);
  background-color: transparent;
}

.social-icons a.facebook {
  color: #3b5998;
}

.social-icons a.twitter {
  color: #1da1f2;
}

.social-icons a.instagram {
  color: #e1306c;
}

.social-icons a.youtube {
  color: #FF0000;
}

.social-icons a.tiktok {
  color: #000000;
}

/* ===== FOOTER ===== */
footer {
  background: linear-gradient(135deg, #212529 0%, #343a40 100%);
  color: #fff;
  padding: 3rem;
  text-align: center;
  border-radius: 30px 30px 0 0;
  margin-top: 3rem;
}

.pie {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.informacion, .recursos {
  flex-basis: 48%;
  padding: 1rem;
}

.informacion h3, .recursos h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #fff;
  position: relative;
  display: inline-block;
}

.informacion h3::after, .recursos h3::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #6e1893, #9a4ede);
}

.informacion p {
  line-height: 1.8;
  color: #adb5bd;
  text-align: left;
}

.recursos ul {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.recursos li {
  margin-bottom: 1rem;
}

.recursos a {
  color: #adb5bd;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.3rem 0;
  display: inline-block;
  position: relative;
}

.recursos a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #fff;
  transition: width 0.3s ease;
}

.recursos a:hover {
  color: #fff;
  background-color: transparent;
}

.recursos a:hover::after {
  width: 100%;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  backdrop-filter: blur(5px);
}

.modal-contenido {
  background-color: white;
  padding: 2.5rem;
  border-radius: 15px;
  text-align: center;
  max-width: 90%;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.modal-imagen {
  width: 60px;
  max-width: 100%;
  display: block;
  margin: 0 auto 1.5rem;
}

.modal-texto {
  margin: 1.5rem 0;
  font-size: 1rem;
  text-align: justify;
  line-height: 1.8;
  color: #555;
}

.modal-boton {
  background: linear-gradient(90deg, #6e1893, #9a4ede);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 0.8rem 2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(110, 24, 147, 0.3);
  transition: all 0.3s ease;
}

.modal-boton:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(110, 24, 147, 0.4);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Menu animation with staggered delay */
.menu a:nth-child(1) { animation: slideIn 0.6s ease-in-out 0.1s both; }
.menu a:nth-child(2) { animation: slideIn 0.6s ease-in-out 0.2s both; }
.menu a:nth-child(3) { animation: slideIn 0.6s ease-in-out 0.3s both; }
.menu a:nth-child(4) { animation: slideIn 0.6s ease-in-out 0.4s both; }
.menu a:nth-child(5) { animation: slideIn 0.6s ease-in-out 0.5s both; }
.menu a:nth-child(6) { animation: slideIn 0.6s ease-in-out 0.6s both; }
.menu a:nth-child(7) { animation: slideIn 0.6s ease-in-out 0.7s both; }

/* ===== RESOURCE CARD STYLES (from paste.txt) ===== */
.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 2.5rem;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  background: #ffffff;
  width: 95%;
}

.search-container {
  background-color: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.05);
}

.resource-card {
  height: 100%;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  border: none;
  border-radius: 15px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.resource-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.616);
}

.card-header {
  font-weight: 600;
  background: linear-gradient(135deg, #212529 0%, #343a40 100%);
  color: white;
  padding: 1rem 1.5rem;
  letter-spacing: 0.5px;
}

.matematicas .card-header {
  background: linear-gradient(135deg, #4c056a 0%, #9a4ede 100%);
}

.fisica .card-header {
  background: linear-gradient(135deg, #343a40 0%, #495057 100%);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background-color: rgba(248,249,250,0.7);
  border-top: 1px solid rgba(0,0,0,0.05);
  padding: 1rem;
  font-size: 0.9rem;
  color: #6c757d;
}

.badge-category {
  color: rgb(0, 0, 0);
  font-weight: bold;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  display: inline-block;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filter-container {
  margin-bottom: 2rem;
}

.filter-scroll {
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.filter-scroll::-webkit-scrollbar {
  height: 6px;
}

.filter-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 3px;
}

.filter-btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  background-color: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
  padding: 0.5rem 1.2rem;
  transition: all 0.3s ease;
  display: inline-block;
  font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
  background: linear-gradient(135deg, #6e1893 0%, #9a4ede 100%);
  color: white;
  border-color: #6e1893;
  box-shadow: 0 4px 10px rgba(110, 24, 147, 0.2);
}

#searchInput {
  border-radius: 30px;
  padding: 0.8rem 1.5rem;
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  width: 100%;
  font-size: 1rem;
}

#searchInput:focus {
  border-color: #6e1893;
  box-shadow: 0 4px 15px rgba(110, 24, 147, 0.1);
  outline: none;
}

.input-group {
  display: flex;
  align-items: center;
}

.input-group-text {
  border-radius: 30px 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
}

.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  margin-top: 3rem;
  color: #6c757d;
}

.btn-floating {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  text-align: center;
  line-height: 60px;
  background: linear-gradient(135deg, #6e1893 0%, #9a4ede 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(110, 24, 147, 0.3);
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.btn-floating:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(110, 24, 147, 0.4);
}

/* ===== RESPONSIVE STYLES ===== */
@media screen and (max-width: 768px) {
  .container {
    padding: 1.5rem;
    width: 100%;
    margin: 20px auto;
  }
  
  .search-container {
    padding: 1.5rem;
  }
  
  .resource-card {
    margin-bottom: 1.5rem;
  }
  
  #resourcesContainer > div {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }
  
  .cabecera {
    padding: 1rem 0;
  }
  
  #img {
    width: 25%;
  }
  
  nav {
    padding: 0.8rem 1rem;
  }
  
  nav ul li {
    margin-left: 0.8rem;
  }
  
  .menu a {
    width: 150px;
    height: 150px;
    margin: 0.8rem;
  }
  
  .contenido h2 {
    font-size: 2.2rem;
  }
  
  .contenido p {
    font-size: 1.1rem;
  }
  
  .pie {
    flex-direction: column;
  }
  
  .informacion, .recursos {
    flex-basis: 100%;
    margin-bottom: 2rem;
  }
  
  .modal-contenido {
    padding: 1.5rem;
    max-height: 90vh;
  }
  
  .modal-texto {
    font-size: 0.9rem;
  }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .container {
    width: 95%;
  }
  
  #resourcesContainer > div {
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }
  
  .menu a {
    width: 160px;
    height: 160px;
  }
}

@media screen and (min-width: 1025px) {
  #resourcesContainer > div {
    width: 33.333%;
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media screen and (min-width: 1400px) {
  #resourcesContainer > div {
    width: 25%;
    flex: 0 0 25%;
    max-width: 25%;
    padding-right: 1.2rem;
    padding-left: 1.2rem;
  }
} 