/**
 * RavencoreX MAG - Site Alignment Styles
 * Alinea elementos comunes de la revista con el resto del sitio
 * manteniendo la identidad visual dark de la revista
 */

/* ========================================
   BOTONES - Alineados con sitio
   ======================================== */

.mag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  font-family: var(--mag-font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.mag-btn-primary {
  background: linear-gradient(135deg, #0c82f5, #6fd2fc);
  color: #FFFFFF;
  box-shadow: none;
}

.mag-btn-primary:hover {
  background: linear-gradient(135deg, #0968c4, #58a8c9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(12, 130, 245, 0.25);
}

.mag-btn-secondary {
  background: transparent;
  color: var(--mag-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.mag-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   BREADCRUMBS - Alineados con sitio
   ======================================== */

.mag-breadcrumb {
  font-size: 0.875rem;
  color: var(--mag-text-secondary);
  margin-bottom: 2rem;
  font-family: var(--mag-font-body);
}

.mag-breadcrumb a {
  color: #0c82f5;
  text-decoration: none;
  transition: color 0.3s ease;
}

.mag-breadcrumb a:hover {
  color: #6fd2fc;
  text-decoration: underline;
}

.mag-breadcrumb-separator {
  margin: 0 0.5rem;
  color: var(--mag-text-secondary);
  opacity: 0.5;
}

/* ========================================
   LINKS - Alineados con sitio
   ======================================== */

.mag-article-content a:not(.mag-btn):not(.mag-cta) {
  color: #0c82f5;
  text-decoration: none;
  border-bottom: 1px solid rgba(12, 130, 245, 0.3);
  transition: all 0.3s ease;
}

.mag-article-content a:not(.mag-btn):not(.mag-cta):hover {
  color: #6fd2fc;
  border-bottom-color: #6fd2fc;
}

/* ========================================
   TABLE OF CONTENTS - Mejorado
   ======================================== */

.mag-toc {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.mag-toc:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.mag-toc-list a {
  position: relative;
  padding-left: 1rem;
  transition: all 0.3s ease;
}

.mag-toc-list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: linear-gradient(135deg, #0c82f5, #6fd2fc);
  border-radius: 2px;
  transition: height 0.3s ease;
}

.mag-toc-list a:hover::before,
.mag-toc-list a.active::before {
  height: 100%;
}

.mag-toc-list a:hover,
.mag-toc-list a.active {
  color: #0c82f5;
  padding-left: 1.25rem;
}

/* ========================================
   CTA BUTTONS - Alineados
   ======================================== */

.mag-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  font-family: var(--mag-font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mag-cta-primary {
  background: linear-gradient(135deg, #0c82f5, #6fd2fc);
  color: #FFFFFF;
}

.mag-cta-primary:hover {
  background: linear-gradient(135deg, #0968c4, #58a8c9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(12, 130, 245, 0.25);
}

.mag-cta-primary .mag-cta-icon {
  transition: transform 0.3s ease;
}

.mag-cta-primary:hover .mag-cta-icon {
  transform: translateX(4px);
}

.mag-cta-secondary {
  background: transparent;
  color: var(--mag-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.mag-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   CODE BLOCKS - Glassmorphism Design
   ======================================== */

.mag-code-block {
  position: relative;
  background: rgba(14, 17, 22, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 8px 32px 0 rgba(0, 0, 0, 0.4),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.mag-code-block:hover {
  border-color: rgba(12, 130, 245, 0.3);
  box-shadow:
    0 12px 48px 0 rgba(12, 130, 245, 0.15),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.mag-code-header {
  background: linear-gradient(135deg, rgba(12, 130, 245, 0.15) 0%, rgba(111, 210, 252, 0.08) 100%);
  border-bottom: 1px solid rgba(12, 130, 245, 0.25);
  color: #6fd2fc;
  padding: 1rem 1.5rem;
  font-family: var(--mag-font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mag-code-block pre {
  margin: 0;
  padding: 1.5rem;
  background: transparent;
  overflow-x: auto;
}

.mag-code-block code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   ARCHITECTURE CARDS - Glassmorphism Flow
   ======================================== */

.mag-architecture-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 3rem 0;
  position: relative;
}

.mag-arch-card {
  position: relative;
  width: 100%;
  max-width: 600px;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow:
    0 8px 32px 0 rgba(0, 0, 0, 0.3),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mag-arch-card:hover {
  transform: translateY(-4px);
  border-color: rgba(12, 130, 245, 0.3);
  box-shadow:
    0 12px 48px 0 rgba(12, 130, 245, 0.2),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.1);
}

.mag-arch-card-highlight {
  background: linear-gradient(135deg, rgba(12, 130, 245, 0.08) 0%, rgba(111, 210, 252, 0.04) 100%);
  border-color: rgba(12, 130, 245, 0.25);
}

.mag-arch-card-highlight:hover {
  background: linear-gradient(135deg, rgba(12, 130, 245, 0.12) 0%, rgba(111, 210, 252, 0.06) 100%);
  border-color: rgba(12, 130, 245, 0.4);
}

.mag-arch-card-side {
  max-width: 400px;
  background: linear-gradient(135deg, rgba(111, 210, 252, 0.08) 0%, rgba(12, 130, 245, 0.04) 100%);
  border-color: rgba(111, 210, 252, 0.25);
  margin-top: 2rem;
}

.mag-arch-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #0c82f5, #6fd2fc);
  border-radius: 16px;
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(12, 130, 245, 0.3);
  transition: all 0.3s ease;
}

.mag-arch-card:hover .mag-arch-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 30px rgba(12, 130, 245, 0.5);
}

.mag-arch-title {
  font-family: var(--mag-font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: #FFFFFF;
  text-align: center;
  margin-bottom: 0.5rem;
}

.mag-arch-subtitle {
  font-family: var(--mag-font-body);
  font-size: 0.9rem;
  color: var(--mag-text-secondary);
  text-align: center;
  margin-bottom: 1.5rem;
}

.mag-arch-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mag-arch-list li {
  font-family: var(--mag-font-body);
  font-size: 0.95rem;
  color: var(--mag-text-secondary);
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.mag-arch-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #0c82f5;
  font-weight: bold;
  transition: all 0.3s ease;
}

.mag-arch-card:hover .mag-arch-list li::before {
  left: 0.25rem;
}

.mag-arch-list li:hover {
  color: #FFFFFF;
  padding-left: 2rem;
}

.mag-arch-arrow {
  font-size: 2rem;
  color: #0c82f5;
  margin: 0.5rem 0;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* Responsive */
@media (max-width: 767px) {
  .mag-arch-card {
    max-width: 100%;
    padding: 1.5rem;
  }

  .mag-arch-icon {
    width: 48px;
    height: 48px;
  }

  .mag-arch-icon svg {
    width: 24px;
    height: 24px;
  }

  .mag-arch-title {
    font-size: 1.25rem;
  }
}

/* ========================================
   RESULT CARDS - Mejorado
   ======================================== */

.mag-result-card {
  background: linear-gradient(135deg, rgba(12, 130, 245, 0.12) 0%, rgba(111, 210, 252, 0.05) 100%);
  border: 1px solid rgba(12, 130, 245, 0.25);
  transition: all 0.3s ease;
}

.mag-result-card:hover {
  transform: translateY(-4px);
  border-color: rgba(12, 130, 245, 0.4);
  box-shadow: 0 8px 24px rgba(12, 130, 245, 0.15);
}

.mag-result-number {
  background: linear-gradient(135deg, #0c82f5, #6fd2fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   PULLQUOTES - Mejorado
   ======================================== */

.mag-pullquote {
  background: linear-gradient(135deg, rgba(12, 130, 245, 0.08) 0%, rgba(111, 210, 252, 0.03) 100%);
  border-left: 4px solid #0c82f5;
}

.mag-pullquote cite {
  color: #0c82f5;
}

/* ========================================
   BADGES - Alineados
   ======================================== */

.mag-case-study-badge {
  background: rgba(12, 130, 245, 0.1);
  border: 1px solid rgba(12, 130, 245, 0.3);
  color: #0c82f5;
}

/* ========================================
   AUTHOR BIO - Mejorado
   ======================================== */

.mag-author-avatar {
  border: 3px solid #0c82f5;
  box-shadow: 0 4px 12px rgba(12, 130, 245, 0.25);
}

.mag-author-title {
  color: #0c82f5;
}

.mag-author-links a {
  color: #0c82f5;
  transition: all 0.3s ease;
}

.mag-author-links a:hover {
  color: #6fd2fc;
  text-decoration: underline;
}

/* ========================================
   SECTION TITLES - Mejorado
   ======================================== */

.mag-section h2 {
  border-top: 2px solid rgba(12, 130, 245, 0.2);
}

.mag-section h4 {
  color: #0c82f5;
}

/* ========================================
   TIP CARDS - Mejorado
   ======================================== */

.mag-tip-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.mag-tip-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(12, 130, 245, 0.3);
  transform: translateX(8px);
}

.mag-tip-content code {
  background: rgba(12, 130, 245, 0.1);
  color: #0c82f5;
  border: 1px solid rgba(12, 130, 245, 0.2);
}

/* ========================================
   CHECKLIST - Mejorado
   ======================================== */

.mag-checklist li::before {
  color: #0c82f5;
  font-size: 1.25rem;
  font-weight: bold;
}

/* ========================================
   ARTICLE ACTIONS - Mejorado
   ======================================== */

.mag-article-actions {
  gap: 0.75rem;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 767px) {
  .mag-btn,
  .mag-cta {
    width: 100%;
    justify-content: center;
  }

  .mag-article-actions {
    flex-direction: column;
  }
}

/* ========================================
   SMOOTH TRANSITIONS - Global
   ======================================== */

* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   FOCUS STATES - Accesibilidad
   ======================================== */

.mag-btn:focus-visible,
.mag-cta:focus-visible,
.mag-toc-list a:focus-visible {
  outline: 2px solid #0c82f5;
  outline-offset: 2px;
}
