/* =============================================
   MATERIAS — Plataforma Educativa
   ============================================= */

/* ─── VARIABLES ─── */
:root {
  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body: 'DM Sans', system-ui, sans-serif;
  --ff-mono: 'DM Mono', monospace;
  --gold: #d4852c;
  --gold-light: #e8a752;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --green: #22c55e;
  --cream: #1a1a1a;
  --text: #2d2d2d;
  --text-muted: #666666;
  --text-dim: #555555;
  --bg: #f8f9fa;
  --bg-2: #f0f2f7;
  --bg-card: #ffffff;
  --border: rgba(212,133,44,0.15);
  --border-dim: rgba(212,133,44,0.08);
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-gold: 0 4px 16px rgba(212,133,44,0.15);
}

/* ─── SECCIÓN ENTREGAS ─── */
#entregas-section {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--border-dim);
}

.entregas-card {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 10px;
  padding: 12px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(59,130,246,0.15);
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
}

.entregas-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: float 8s ease-in-out infinite;
}

.entregas-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s ease;
}

.entregas-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(59,130,246,0.35);
}

.entregas-card:hover::after {
  animation: shimmer .8s ease;
}

.entregas-icon {
  font-size: 1.3rem;
  margin-bottom: 2px;
  animation: bounce 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
  display: inline-block;
}

.entregas-title {
  font-family: var(--ff-display);
  font-size: .95rem;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.entregas-desc {
  color: rgba(255,255,255,0.9);
  font-size: .73rem;
  line-height: 1.3;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.entregas-button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.95);
  color: var(--blue);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: .7rem;
  transition: all .3s ease;
  position: relative;
  z-index: 1;
  cursor: pointer;
  border: none;
}

.entregas-button:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ─── SECCIÓN MATERIAS ─── */
#materias {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  padding: 40px 0;
}

.materias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 20px;
  margin-top: 40px;
}

.materia-card {
  background: var(--bg-card);
  border: 2px solid var(--border-dim);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

.materia-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #ff6b6b, #ff8e53, #feca57, #48dbfb, #1dd1a1);
  transform: translateX(-100%);
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}

.materia-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 150% 50%, rgba(59,130,246,.08), transparent);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

.materia-card:hover {
  border-color: var(--gold);
  box-shadow: 0 16px 40px rgba(212,133,44,.2);
  transform: translateY(-12px) scale(1.02);
}

.materia-card:hover::before {
  transform: translateX(0);
}

.materia-card:hover::after {
  opacity: 1;
}

/* ─── MATERIA HEADER ─── */
.materia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.materia-icon {
  font-size: 2.4rem;
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
}

.materia-card:hover .materia-icon {
  transform: scale(1.2) rotate(10deg);
}

.materia-badge {
  font-family: var(--ff-mono);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
}

/* ─── COLORES POR MATERIA ─── */
.materia-creativo .materia-badge {
  background: rgba(248,113,113,0.15);
  color: #ff6b6b;
}

.materia-creativo:hover {
  border-color: #ff6b6b;
  box-shadow: 0 16px 40px rgba(255,107,107,.2);
}

.materia-tecnologia .materia-badge {
  background: rgba(59,130,246,0.15);
  color: var(--blue);
}

.materia-tecnologia:hover {
  border-color: var(--blue);
  box-shadow: 0 16px 40px rgba(59,130,246,.2);
}

.materia-tesis .materia-badge {
  background: rgba(139,92,246,0.15);
  color: var(--purple);
}

.materia-tesis:hover {
  border-color: var(--purple);
  box-shadow: 0 16px 40px rgba(139,92,246,.2);
}

/* ─── MATERIA CONTENT ─── */
.materia-title {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cream), var(--text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all .3s;
  margin: 0;
}

.materia-card:hover .materia-title {
  transform: translateX(4px);
}

.materia-desc {
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.6;
  flex-grow: 1;
  transition: color .3s;
  margin: 0;
}

.materia-card:hover .materia-desc {
  color: var(--text);
}

.materia-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.materia-tag {
  font-size: .65rem;
  background: linear-gradient(135deg, rgba(212,133,44,.12), rgba(59,130,246,.08));
  border: 1.5px solid rgba(212,133,44,.2);
  color: var(--gold);
  padding: 6px 12px;
  border-radius: 100px;
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
  transition: all .25s;
}

.materia-card:hover .materia-tag {
  background: linear-gradient(135deg, rgba(212,133,44,.2), rgba(59,130,246,.15));
  border-color: var(--gold);
  transform: scale(1.05);
}

.materia-arrow {
  font-size: .9rem;
  color: var(--gold);
  font-weight: 700;
  transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.materia-card:hover .materia-arrow {
  transform: translateX(8px);
  color: #ff6b6b;
}

.materia-tecnologia:hover .materia-arrow {
  color: var(--blue);
}

.materia-tesis:hover .materia-arrow {
  color: var(--purple);
}

/* ─── ANIMACIONES ─── */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(20px) rotate(5deg); }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  #entregas-section {
    padding: 50px 0 30px;
  }

  #materias {
    padding: 50px 0;
  }

  .materias-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 30px;
  }

  .entregas-card {
    padding: 18px 24px;
  }

  .entregas-icon {
    font-size: 1.8rem;
  }

  .entregas-title {
    font-size: 1.1rem;
  }

  .entregas-desc {
    font-size: .8rem;
  }

  .materia-card {
    padding: 20px;
    gap: 10px;
  }

  .materia-icon {
    font-size: 2rem;
  }

  .materia-title {
    font-size: 1.1rem;
  }

  .materia-desc {
    font-size: .85rem;
  }
}

@media (max-width: 600px) {
  #entregas-section {
    padding: 60px 0 40px;
  }

  #materias {
    padding: 60px 0;
  }

  .entregas-card {
    padding: 28px;
    margin: 0 auto;
  }

  .entregas-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
  }

  .entregas-title {
    font-size: 1.4rem;
    margin-bottom: 8px;
  }

  .entregas-desc {
    font-size: .88rem;
    margin-bottom: 20px;
  }

  .entregas-button {
    padding: 12px 24px;
    font-size: .85rem;
  }

  .materias-grid {
    gap: 16px;
  }

  .materia-card {
    padding: 20px;
    gap: 12px;
  }

  .materia-header {
    margin-bottom: 8px;
  }

  .materia-icon {
    font-size: 2rem;
  }

  .materia-badge {
    font-size: .6rem;
    padding: 4px 10px;
  }

  .materia-title {
    font-size: 1.1rem;
  }

  .materia-desc {
    font-size: .88rem;
    line-height: 1.6;
  }

  .materia-tag {
    font-size: .6rem;
    padding: 4px 10px;
  }

  .materia-arrow {
    font-size: .85rem;
  }
}
