/*
 * Bootstrap 3 Base CSS for OJS (Open Journal Systems)
 * Estructura base extra�da del an�lisis del sitio demo:
 * https://ojs33.demo.publicknowledgeproject.org/index.php/boot1
 * Organizada para facilitar personalizaciones futuras
 */

/* ==========================================================================
   01. SETTINGS - Variables y tokens de dise�o
   ========================================================================== */

:root {
  /* Colores principales */
  --c-primary: #00b3c0;
  --c-primary-dark: #0cb1bf;
  --c-secondary: #518fa6;
  --c-secondary-dark: #3d859f;
  --c-accent: #006985;
  --c-accent-dark: #00657e;
  
  /* Colores neutros */
  --c-white: #ffffff;
  --c-light-gray: #f5f5f5;
  --c-light-blue: #eff3f5;
  --c-dark-gray: #333333;
  --c-text: #333333;
  --c-text-light: #666666;
  
  /* Tipograf�a */
  --font-family-base: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --fs-base: 16px;
  --fs-sm: 14px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  --fs-xxl: 36px;
  --fs-xxxl: 48px;
  
  /* Espaciados */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  
  /* Bordes y radios */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;
  
  /* Transiciones */
  --transition-base: all 0.3s ease;
  --transition-fast: all 0.15s ease;
  
  /* Contenedor m�ximo */
  --container-max-width: 1200px;
}

/* ==========================================================================
   02. TOOLS - Mixins y helpers (simulados con clases)
   ========================================================================== */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ==========================================================================
   03. GENERIC - Resets y estilos root
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  font-size: var(--fs-base);
  line-height: 1.6;
}

body {
  font-family: var(--font-family-base);
  color: var(--c-text);
  background-color: var(--c-white);
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   04. ELEMENTS - Tipograf�a base, links, tables
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-base);
  font-weight: 600;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: var(--space-3);
  color: var(--c-accent-dark);
}

h1 { font-size: var(--fs-xxxl); }
h2 { font-size: var(--fs-xxl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-base); }
h6 { font-size: var(--fs-sm); }

p {
  margin-top: 0;
  margin-bottom: var(--space-3);
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* Tablas */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-4);
}

th, td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: var(--c-light-blue);
  font-weight: 600;
}

/* Navegaci�n principal OJS */
.navbar {
  background-color: var(--c-white);
  border: 1px solid #e7e7e7;
  border-radius: 4px;
  margin-bottom: var(--space-4);
}

.navbar-default {
  background-color: #f8f8f8;
  border-color: #e7e7e7;
}

.navbar-brand {
  float: left;
  height: 50px;
  padding: 15px;
  font-size: 18px;
  line-height: 20px;
}

.navbar-brand-logo img {
  height: 30px;
  width: auto;
}

.navbar-collapse {
  padding-right: 15px;
  padding-left: 15px;
  overflow-x: visible;
  border-top: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Breadcrumbs OJS */
.breadcrumb,
.cmp_breadcrumbs {
  padding: 8px 15px;
  margin-bottom: var(--space-3);
  list-style: none;
  background-color: #f5f5f5;
  border-radius: 4px;
}

.breadcrumb > li {
  display: inline-block;
}

.breadcrumb > li + li:before {
  padding: 0 5px;
  color: #ccc;
  content: "/\\00a0";
}

/* Media objects para art�culos */
.media {
  margin-top: 15px;
}

.media:first-child {
  margin-top: 0;
}

.media,
.media .media {
  margin-top: 15px;
}

.media-object {
  display: block;
}

.media-object.img-thumbnail {
  max-width: none;
}

.media-right,
.media > .pull-right {
  padding-left: 10px;
}

.media-left,
.media > .pull-left {
  padding-right: 10px;
}

.media-left,
.media-right,
.media-body {
  display: table-cell;
  vertical-align: top;
}

.media-middle {
  vertical-align: middle;
}

.media-bottom {
  vertical-align: bottom;
}

.media-heading {
  margin-top: 0;
  margin-bottom: 5px;
}

.media-list {
  padding-left: 0;
  list-style: none;
}

/* Res�menes de n�meros OJS */
.issue-summary {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid #ddd;
  border-radius: var(--radius-md);
}

.issue-summary .cover {
  float: left;
  margin-right: var(--space-3);
  margin-bottom: var(--space-2);
}

.issue-summary .cover img {
  max-width: 100px;
  height: auto;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
}

.issue-summary .description {
  overflow: hidden;
}

.issues {
  margin-bottom: var(--space-4);
}

/* Dropdown menus */
.dropdown {
  position: relative;
}

.dropdown-toggle:focus {
  outline: 0;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  float: left;
  min-width: 160px;
  padding: 5px 0;
  margin: 2px 0 0;
  font-size: 14px;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

.dropdown-menu.pull-right {
  right: 0;
  left: auto;
}

.dropdown-menu .divider {
  height: 1px;
  margin: 9px 0;
  overflow: hidden;
  background-color: #e5e5e5;
}

.dropdown-menu > li > a {
  display: block;
  padding: 3px 20px;
  clear: both;
  font-weight: normal;
  line-height: 1.42857143;
  color: #333;
  white-space: nowrap;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  color: #262626;
  text-decoration: none;
  background-color: #f5f5f5;
}

.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
  color: #fff;
  text-decoration: none;
  background-color: #337ab7;
  outline: 0;
}

/* Formularios */
.form-group {
  margin-bottom: 15px;
}

.form-control {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background-color: #fff;
  background-image: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}

.form-control:focus {
  border-color: #66afe9;
  outline: 0;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}

/* Botones espec�ficos OJS */
.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}

.btn-default:focus,
.btn-default.focus {
  color: #333;
  background-color: #e6e6e6;
  border-color: #8c8c8c;
}

.btn-default:hover {
  color: #333;
  background-color: #e6e6e6;
  border-color: #adadad;
}

/* Elementos espec�ficos del sitio */
.has_site_logo .navbar-brand {
  padding: 10px 15px;
}

.navbar-brand-logo {
  display: inline-block;
}

/* Collapse para navegaci�n m�vil */
.collapse {
  display: none;
}

.collapse.in {
  display: block;
}

.collapsing {
  position: relative;
  height: 0;
  overflow: hidden;
  transition-timing-function: ease;
  transition-duration: 0.35s;
  transition-property: height, visibility;
}

/* Iconos de hamburguesa */
.icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background-color: #888;
}

.navbar-toggle {
  position: relative;
  float: right;
  padding: 9px 10px;
  margin-top: 8px;
  margin-right: 15px;
  margin-bottom: 8px;
  background-color: transparent;
  background-image: none;
  border: 1px solid transparent;
  border-radius: 4px;
}

.navbar-toggle:focus {
  outline: 0;
}

.navbar-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
}

.navbar-toggle .icon-bar + .icon-bar {
  margin-top: 4px;
}

/* Caret para dropdowns */
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px dashed;
  border-top: 4px solid \\9;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* Pills navigation */
.nav-pills > li {
  float: left;
}

.nav-pills > li > a {
  border-radius: 4px;
}

.nav-pills > li + li {
  margin-left: 2px;
}

.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
  color: #fff;
  background-color: #337ab7;
}

/* Contenedor principal */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* Header y Navbar */
.pkp_site_header {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 100%);
  color: var(--c-white);
  padding: var(--space-4) 0;
  position: relative;
  overflow: hidden;
}

.pkp_site_header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('assets/img/bannersuperior.jpg');
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
  opacity: 0.3;
  z-index: 1;
}

.pkp_site_header > * {
  position: relative;
  z-index: 2;
}

.pkp_site_name {
  font-size: var(--fs-xxxl);
  font-weight: 700;
  margin: 0;
  text-align: center;
}

.pkp_site_name a {
  color: var(--c-white);
  text-decoration: none;
}

.pkp_site_name a:hover {
  color: var(--c-white);
  text-decoration: none;
}

.pkp_site_description {
  font-size: var(--fs-lg);
  text-align: center;
  margin: var(--space-2) 0 0 0;
  opacity: 0.9;
}

/* Navegaci�n principal */
.pkp_navigation_primary {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  margin-top: var(--space-4);
  border-radius: var(--radius-md);
}

.pkp_navigation_primary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.pkp_navigation_primary li {
  margin: 0;
}

.pkp_navigation_primary a {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--c-white);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-base);
  border-radius: var(--radius-sm);
}

.pkp_navigation_primary a:hover,
.pkp_navigation_primary a:focus {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--c-white);
  text-decoration: none;
}

/* Botones */
.btn {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-base);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  line-height: 1.5;
}

.btn-primary {
  background-color: var(--c-primary);
  color: var(--c-white);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--c-primary-dark);
  color: var(--c-white);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 179, 192, 0.3);
}

.btn-accent {
  background-color: var(--c-accent);
  color: var(--c-white);
}

.btn-accent:hover,
.btn-accent:focus {
  background-color: var(--c-accent-dark);
  color: var(--c-white);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 105, 133, 0.3);
}

/* Cards y contenedores */
.card {
  background-color: var(--c-white);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--transition-base);
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.card-header {
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin: 0;
  color: var(--c-text);
}

/* Sidebar widgets */
.sidebar-widget {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border-left: 4px solid var(--c-primary);
}

.sidebar-widget h3 {
  color: var(--c-primary);
  font-size: var(--fs-lg);
  margin-bottom: var(--space-3);
}

/* Paginaci�n */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-5) 0;
  gap: var(--space-2);
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  color: var(--c-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.pagination a:hover {
  background-color: var(--c-primary);
  color: var(--c-white);
  border-color: var(--c-primary);
}

.pagination .current {
  background-color: var(--c-primary);
  color: var(--c-white);
  border-color: var(--c-primary);
}

/* ==========================================================================
   06. LAYOUT - Grids, header, footer, side-rail, content-area
   ========================================================================== */

.pkp_structure_main {
  display: flex;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-3);
  gap: var(--space-5);
}

.pkp_structure_content {
  flex: 1;
  min-width: 0;
}

.pkp_structure_sidebar {
  flex: 0 0 300px;
  min-width: 300px;
}

/* Footer */
.pkp_structure_footer {
  background-color: var(--c-primary);
  color: var(--c-white);
  padding: var(--space-5) 0;
  margin-top: var(--space-6);
}

.pkp_structure_footer a {
  color: var(--c-white);
}

.pkp_structure_footer a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   07. PAGES - Reglas espec�ficas por plantilla
   ========================================================================== */

/* P�gina de inicio */
.page-index .current-issue {
  background: linear-gradient(135deg, var(--c-light-blue) 0%, rgba(255, 255, 255, 0.9) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.page-index .current-issue h2 {
  color: var(--c-primary);
  text-align: center;
  margin-bottom: var(--space-4);
}

/* Listado de archivos */
.page-archives .volume-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.volume-item {
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border-left: 4px solid var(--c-primary);
}

.volume-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: var(--space-3);
}

.issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.issue-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(0, 179, 192, 0.1);
}

.issue-list li:last-child {
  border-bottom: none;
}

.issue-list a {
  color: var(--c-secondary);
  font-weight: 500;
}

.issue-list a:hover {
  color: var(--c-secondary-dark);
}

/* Art�culos */
.article-summary {
  border-left: 4px solid var(--c-primary);
  padding-left: var(--space-4);
  margin-bottom: var(--space-5);
}

.article-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.article-title a {
  color: var(--c-text);
}

.article-title a:hover {
  color: var(--c-primary);
}

.article-authors {
  color: var(--c-text-light);
  font-style: italic;
  margin-bottom: var(--space-2);
}

.article-pages {
  color: var(--c-primary);
  font-weight: 500;
  font-size: var(--fs-sm);
}

/* ==========================================================================
   08. UTILITIES - Helpers de margen, padding, text-align, display
   ========================================================================== */

/* M�rgenes */
.m-0 { margin: 0 !important; }
.m-1 { margin: var(--space-1) !important; }
.m-2 { margin: var(--space-2) !important; }
.m-3 { margin: var(--space-3) !important; }
.m-4 { margin: var(--space-4) !important; }
.m-5 { margin: var(--space-5) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-5 { margin-bottom: var(--space-5) !important; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-1 { padding: var(--space-1) !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-5 { padding: var(--space-5) !important; }

/* Alineaci�n de texto */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }

/* ==========================================================================
   09. RESPONSIVE - Media queries para diferentes breakpoints
   ========================================================================== */

/* Tablet y m�vil */
@media (max-width: 991px) {
  .pkp_structure_main {
    flex-direction: column;
    gap: var(--space-4);
  }
  
  .pkp_structure_sidebar {
    flex: none;
    min-width: auto;
    order: 2;
  }
  
  .pkp_navigation_primary ul {
    flex-direction: column;
    align-items: center;
  }
  
  .pkp_navigation_primary a {
    padding: var(--space-2) var(--space-3);
  }
}

/* M�vil */
@media (max-width: 575px) {
  .container,
  .pkp_structure_main {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
  
  .pkp_site_name {
    font-size: var(--fs-xxl);
  }
  
  .pkp_site_description {
    font-size: var(--fs-base);
  }
  
  .card {
    padding: var(--space-3);
  }
  
  .sidebar-widget {
    padding: var(--space-3);
  }
  
  /* Convertir tablas a list-view en m�vil */
  .table-responsive {
    display: block;
  }
  
  .table-responsive table,
  .table-responsive thead,
  .table-responsive tbody,
  .table-responsive th,
  .table-responsive td,
  .table-responsive tr {
    display: block;
  }
  
  .table-responsive thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .table-responsive tr {
    border: 1px solid #ccc;
    margin-bottom: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
  }
  
  .table-responsive td {
    border: none;
    position: relative;
    padding-left: 50%;
  }
  
  .table-responsive td:before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
  }
}

/* ==========================================================================
   10. ACCESIBILIDAD Y PERFORMANCE
   ========================================================================== */

/* Reducir movimiento para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visible mejorado */
*:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* Mejoras de contraste para texto peque�o */
.small-text {
  color: var(--c-text);
  font-weight: 500;
}

/* Print styles */
@media print {
  .pkp_navigation_primary,
  .sidebar-widget,
  .btn {
    display: none !important;
  }
  
  .pkp_structure_main {
    flex-direction: column;
  }
  
  a {
    color: var(--c-text) !important;
    text-decoration: underline !important;
  }
}

