/*
Theme Name: Club Computer System - Portal Web
Theme URI: https://club.a3jsistemas.es
Author: Computer System Club
Author URI: https://a3jsistemas.es
Description: Tema oficial de WordPress del Club Computer System. Incluye visor digital interactivo para la revista AI Pulse, repositorio de Material & Recursos y diseño moderno y accesible.
Version: 3.1.0
License: GNU General Public License v2 or later
Text Domain: club-computer-system
*/

/* ==========================================================================
   DESIGN SYSTEM - LIGHT, ACCESSIBLE & FRIENDLY
   ========================================================================== */
:root {
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;

  --color-orange: #f97316;
  --color-orange-dark: #ea580c;
  --color-blue: #2563eb;
  --color-blue-dark: #1d4ed8;
  
  --gradient-primary: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --gradient-blue: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --gradient-hero: linear-gradient(135deg, #eff6ff 0%, #fff7ed 100%);

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --badge-orange: #ea580c;
  --badge-orange-bg: #ffedd5;
  --badge-blue: #2563eb;
  --badge-blue-bg: #dbeafe;
  --badge-green: #059669;
  --badge-green-bg: #d1fae5;
  --badge-purple: #7c3aed;
  --badge-purple-bg: #ede9fe;

  --sidebar-width: 320px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  display: flex;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

/* Sidebar Header - Balanced margins, 100% proportional logo without distortion */
.sidebar-header {
  padding: 14px 20px !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  height: 110px;
  min-height: 110px;
  overflow: hidden;
  width: 100%;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 100% !important;
}

.sidebar-logo {
  max-height: 82px !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
  transition: var(--transition);
}

.sidebar-logo-link:hover .sidebar-logo {
  transform: scale(1.03);
}

.sidebar-nav {
  padding: 14px 16px 24px 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 14px 4px 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--bg-main);
  color: var(--color-orange-dark);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35);
}

.nav-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
}

/* Top Header Navbar */
.top-header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.header-search {
  position: relative;
  width: 440px;
}

.header-search input {
  width: 100%;
  background-color: var(--bg-main);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px 12px 48px;
  color: var(--text-main);
  font-size: 0.98rem;
  font-weight: 500;
  transition: var(--transition);
}

.header-search input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.header-search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

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

.btn-header-action {
  background: var(--bg-main);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.btn-header-action:hover {
  background-color: var(--border-color);
  border-color: var(--border-color-hover);
}

.notification-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-orange);
}

/* Page Content */
.content-area {
  padding: 40px;
  flex-grow: 1;
}

/* Hero / Welcome Banner */
.hero-banner {
  background: var(--gradient-hero);
  border: 1.5px solid #dbeafe;
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-content h1 {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 750px;
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
}

.badge-orange { background: var(--badge-orange-bg); color: var(--badge-orange); border: 1px solid rgba(234, 88, 12, 0.3); }
.badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue); border: 1px solid rgba(37, 99, 235, 0.3); }
.badge-green { background: var(--badge-green-bg); color: var(--badge-green); border: 1px solid rgba(5, 150, 105, 0.3); }
.badge-purple { background: var(--badge-purple-bg); color: var(--badge-purple); border: 1px solid rgba(124, 58, 237, 0.3); }

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title svg {
  color: var(--color-orange);
}

.link-all {
  font-size: 0.95rem;
  color: var(--color-blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.link-all:hover {
  color: var(--color-blue-dark);
  transform: translateX(3px);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

/* Cards Styling */
.card {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.card-media {
  height: 200px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: #e2e8f0;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
}

.card-body {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.4;
}

.card-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-card {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  background: var(--gradient-primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.btn-card:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
}

.btn-secondary {
  background: #f1f5f9;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  box-shadow: none;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* Featured Magazine Widget */
.magazine-featured-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  gap: 32px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.magazine-cover {
  width: 160px;
  height: 220px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.magazine-info {
  display: flex;
  flex-direction: column;
}

.magazine-info h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

/* Certification Grid */
.cert-card {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.cert-card:hover {
  border-color: var(--color-orange);
  box-shadow: var(--shadow-md);
}

.cert-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--badge-orange-bg);
  color: var(--badge-orange);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

/* Footer Site */
.site-footer {
  padding: 28px 40px;
  border-top: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  text-align: right;
  margin-top: auto;
}

/* ==========================================================================
   TABS & INTERACTIVE MODAL VIEWER
   ========================================================================== */
.tab-content { 
  display: none; 
}
.tab-content.active { 
  display: block; 
}

/* Modal Viewer - Oculto por defecto hasta hacer clic */
.reader-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.reader-modal.open { 
  display: flex !important; 
}

.reader-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 1100px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.reader-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.reader-body {
  flex-grow: 1;
  padding: 0;
  background: #000000;
  overflow: hidden;
  height: 100%;
}

.close-btn {
  background: #e2e8f0;
  border: none;
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.close-btn:hover {
  background: #cbd5e1;
}
