/* ============================================
   EMPLEOS ADICRA - Estilos Modernos y Vibrantes
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Paleta de colores ADICRA - más vibrante */
  --primary: #0066CC;
  --primary-dark: #004C99;
  --primary-light: #3399FF;
  --primary-glow: rgba(0, 102, 204, 0.3);
  
  --secondary: #00B4D8;
  --secondary-light: #48CAE4;
  
  --accent: #FF6B35;
  --accent-light: #FF8C5A;
  --accent-glow: rgba(255, 107, 53, 0.3);
  
  /* Fondos y superficies */
  --bg: #FAFCFF;
  --bg-gradient: linear-gradient(135deg, #FAFCFF 0%, #E8F4FF 100%);
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  
  /* Texto */
  --text-primary: #1A1F36;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --text-light: #A0AEC0;
  
  /* Estados */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #EF4444;
  
  /* Efectos */
  --border: rgba(0, 102, 204, 0.1);
  --border-strong: rgba(0, 102, 204, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 102, 204, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 102, 204, 0.12);
  --shadow-xl: 0 20px 60px rgba(0, 102, 204, 0.15);
  --shadow-glow: 0 0 40px var(--primary-glow);
  
  /* Bordes y transiciones */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Patrón de fondo decorativo */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 400px;
  background: linear-gradient(180deg, rgba(0, 102, 204, 0.03) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

main {
  flex: 1;
  position: relative;
}

/* ============================================
   HEADER / TOPBAR
   ============================================ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo img {
  height: 48px;
  width: auto;
  transition: var(--transition);
}

.logo img:hover {
  transform: scale(1.05);
}

.topbar h1 {
  font-size: 0;
  visibility: hidden;
}

/* Navegación */
.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 15px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  opacity: 0;
  transform: scale(0.8);
  border-radius: inherit;
  transition: var(--transition);
  z-index: -1;
}

.nav a:hover {
  color: var(--primary);
}

.nav a:hover::before {
  opacity: 0.08;
  transform: scale(1);
}

.nav a[href="#/auth"],
.nav a[href="#/create-post"] {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-md), 0 4px 12px var(--primary-glow);
}

.nav a[href="#/auth"]:hover,
.nav a[href="#/create-post"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 8px 20px var(--primary-glow);
  color: white;
}

.nav a[href="#/auth"]::before,
.nav a[href="#/create-post"]::before {
  display: none;
}

/* Hamburger menu */
.hamburger {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition);
}

.hamburger:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.container {
  padding: 40px 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.page h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.page > .container > p {
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 32px;
  max-width: 600px;
}

/* ============================================
   PÁGINA DE INICIO - HERO
   ============================================ */
#home .container {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 32px;
}

#home h2 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  line-height: 1.1;
}

#home p {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 40px;
  line-height: 1.7;
}

/* Botones CTA en home */
#home .container::after {
  content: '';
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

/* ============================================
   TARJETAS
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card:hover::before {
  opacity: 1;
}

.card.small {
  padding: 20px;
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.card a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  margin-top: 16px;
  padding: 8px 16px;
  background: rgba(0, 102, 204, 0.08);
  border-radius: var(--radius-full);
  transition: var(--transition);
  font-size: 14px;
}

.card a:hover {
  background: var(--primary);
  color: white;
  transform: translateX(4px);
}

.card a::after {
  content: '→';
  transition: var(--transition);
}

.card a:hover::after {
  transform: translateX(4px);
}

/* ============================================
   GRID DE TARJETAS
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ============================================
   FORMULARIOS
   ============================================ */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.form input,
.form textarea,
.form select {
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: var(--transition);
  width: 100%;
}

.form input::placeholder,
.form textarea::placeholder {
  color: var(--text-light);
}

.form input:hover,
.form textarea:hover,
.form select:hover {
  border-color: var(--border-strong);
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  padding-right: 48px;
}

.form button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md), 0 4px 12px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.form button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  opacity: 0;
  transition: var(--transition);
}

.form button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 8px 24px var(--primary-glow);
}

.form button:hover::before {
  opacity: 1;
}

.form button:active {
  transform: translateY(0);
}

.form button span {
  position: relative;
  z-index: 1;
}

/* ============================================
   FILTROS
   ============================================ */
.filters {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filters input {
  flex: 1;
  min-width: 280px;
  padding: 14px 20px;
  padding-left: 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23A0AEC0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 18px center;
  font-size: 15px;
  color: var(--text-primary);
  transition: var(--transition);
}

.filters input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.filters select {
  padding: 14px 48px 14px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.filters select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* ============================================
   BOTONES DE FAVORITOS
   ============================================ */
.fav-btn {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  color: var(--text-light);
  font-size: 22px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  line-height: 1;
}

.fav-btn:hover {
  background: rgba(251, 191, 36, 0.1);
  color: #F59E0B;
  transform: scale(1.1);
}

.fav-btn.active {
  color: #F59E0B;
  background: rgba(251, 191, 36, 0.15);
}

.fav-btn.active:hover {
  transform: scale(1.15);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-approved {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge-pending {
  background: var(--warning-light);
  color: #92400E;
}

/* ============================================
   ELEMENTOS DE TEXTO
   ============================================ */
.small-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
}

.link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
}

.link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
}

.hidden {
  display: none !important;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: linear-gradient(135deg, var(--text-primary) 0%, #2D3748 100%);
  padding: 40px 32px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  margin-top: auto;
}

.footer p {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}

.footer p + p {
  margin-top: 16px;
}

.disclaimer {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 20px !important;
}

/* ============================================
   POP-UP DE ASOCIACIÓN
   ============================================ */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-overlay.hidden {
  display: none;
}

.popup-content {
  background: var(--surface);
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.popup-content::before {
  content: '🎓';
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.popup-content h3 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.popup-content p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.popup-close:hover {
  background: var(--error);
  border-color: var(--error);
  color: white;
  transform: rotate(90deg);
}

.popup-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, #E85D2A 100%);
  color: white;
  padding: 16px 36px;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: var(--transition);
  box-shadow: var(--shadow-md), 0 4px 16px var(--accent-glow);
}

.popup-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 8px 28px var(--accent-glow);
}

.popup-link {
  display: block;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  margin-top: 20px;
  transition: var(--transition);
}

.popup-link:hover {
  color: var(--primary);
}

/* ============================================
   CV / CÓDIGO
   ============================================ */
.cv {
  white-space: pre-wrap;
  background: var(--bg);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ============================================
   ANIMACIONES DE CARGA
   ============================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 12px 20px;
  }

  .logo img {
    height: 40px;
  }

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    border-radius: var(--radius-md);
  }

  .container {
    padding: 28px 20px;
  }

  .page h2 {
    font-size: 26px;
  }

  #home h2 {
    font-size: 32px;
  }

  #home p {
    font-size: 17px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .filters {
    flex-direction: column;
  }

  .filters input {
    min-width: 100%;
  }

  .form {
    gap: 16px;
  }

  .form input,
  .form textarea,
  .form select,
  .form button {
    padding: 14px 18px;
  }

  .popup-content {
    padding: 36px 28px;
  }

  .popup-content h3 {
    font-size: 24px;
  }

  .footer {
    padding: 32px 20px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 12px 16px;
  }

  .container {
    padding: 24px 16px;
  }

  .card {
    padding: 20px;
  }

  .card.small {
    padding: 16px;
  }

  .popup-btn {
    padding: 14px 28px;
    font-size: 15px;
  }
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* Selección de texto */
::selection {
  background: var(--primary);
  color: white;
}
