/* ===========================
   ESAL PAGE - Coopcarnes v2
   =========================== */

/* PAGE HERO */
.page-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #3498DB 100%);
  padding: 80px 0 60px;
  color: #fff;
  text-align: center;
}
.page-hero h1 { font-size: 44px; color: #fff; margin-bottom: 12px; }
.page-hero p  { font-size: 18px; color: rgba(255,255,255,0.85); }
.breadcrumb   { display: flex; justify-content: center; gap: 8px; margin-top: 16px; font-size: 14px; }
.breadcrumb a { color: rgba(255,255,255,0.7); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { color: rgba(255,255,255,0.5); }

.esal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

/* INFO BANNER */
.esal-info-banner {
  background: #1a1a2e;
  padding: 28px 0;
}
.esal-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.esal-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: rgba(255,255,255,0.85);
}
.esal-info-item > i {
  font-size: 28px;
  color: #3498DB;
  flex-shrink: 0;
  margin-top: 2px;
}
.esal-info-item strong { display: block; color: #fff; font-size: 15px; margin-bottom: 4px; }
.esal-info-item span  { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.5; }

/* LAYOUT */
.esal-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

/* YEAR TABS */
.year-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 2px solid #e8e8e8;
  padding-bottom: 0;
}
.year-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Lato', sans-serif;
  color: #888;
  cursor: pointer;
  transition: all 0.25s ease;
  border-radius: 4px 4px 0 0;
}
.year-tab:hover { color: #3498DB; background: #f0f8ff; }
.year-tab.active { color: #3498DB; border-bottom-color: #3498DB; background: #f0f8ff; }

/* YEAR PANEL */
.year-panel { display: none; }
.year-panel.active { display: block; }

.year-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.year-panel-header h2 {
  font-size: 22px;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 10px;
}
.year-panel-header h2 i { color: #3498DB; }
.doc-count {
  background: #3498DB;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 50px;
}

/* CATEGORY */
.doc-category { margin-bottom: 32px; }
.doc-cat-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-cat-title i { color: #3498DB; }

/* DOC GRID */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* DOC CARD */
.doc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.25s ease;
  cursor: default;
}
.doc-card:hover {
  border-color: #3498DB;
  box-shadow: 0 4px 16px rgba(52,152,219,0.12);
  transform: translateY(-2px);
}
.doc-icon {
  width: 44px;
  height: 44px;
  background: #e8f4fd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-icon i { font-size: 20px; color: #3498DB; }
.doc-info { flex: 1; min-width: 0; }
.doc-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-year-tag {
  display: inline-block;
  background: #e8f4fd;
  color: #3498DB;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
}
.doc-year-old { background: #f0f0f0; color: #888; }

.doc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.doc-btn-view,
.doc-btn-download {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}
.doc-btn-view {
  background: #3498DB;
  color: #fff;
  border: none;
}
.doc-btn-view:hover { background: #2176ae; }
.doc-btn-download {
  background: #f0f0f0;
  color: #555;
  border: none;
}
.doc-btn-download:hover { background: #27ae60; color: #fff; }

/* SIDEBAR */
.esal-sidebar { position: sticky; top: 90px; }
.sidebar-widget {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  margin-bottom: 20px;
}
.sidebar-widget h3 {
  font-size: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3498DB;
  display: inline-block;
}
.sidebar-widget p { font-size: 14px; color: #555; line-height: 1.6; }

.esal-widget-info { background: #e8f4fd; border-left: 4px solid #3498DB; }
.esal-widget-icon { font-size: 28px; color: #3498DB; margin-bottom: 10px; }
.esal-widget-info h3 { border-bottom-color: #3498DB; }

.esal-tips { margin-top: 10px; }
.esal-tips li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #444;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}
.esal-tips li:last-child { border-bottom: none; }
.esal-tips li i { color: #3498DB; width: 16px; text-align: center; }

.esal-legal { margin-top: 10px; }
.esal-legal li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #444;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.4;
}
.esal-legal li:last-child { border-bottom: none; }
.esal-legal li i { color: #3498DB; margin-top: 2px; flex-shrink: 0; }

/* DOC CARD ACTIVE STATE */
.doc-card-active {
  border-color: #3498DB !important;
  background: #e8f4fd !important;
  box-shadow: 0 4px 16px rgba(52,152,219,0.2) !important;
}
.doc-card-active .doc-btn-view {
  background: #1a1a2e;
}

/* INLINE PDF VIEWER */
.pdf-inline-viewer {
  grid-column: 1 / -1;
  background: #fff;
  border: 2px solid #3498DB;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0 8px;
  box-shadow: 0 8px 32px rgba(52,152,219,0.15);
  animation: viewerSlideIn 0.25s ease;
}
@keyframes viewerSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pdf-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #1a1a2e;
  gap: 12px;
}
.pdf-inline-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-inline-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pdf-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  background: #3498DB;
  color: #fff;
}
.pdf-inline-btn:hover { background: #2176ae; color: #fff; }
.pdf-inline-close {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 6px;
  font-size: 15px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.pdf-inline-close:hover { background: #e74c3c; }

.pdf-inline-body {
  position: relative;
  height: 620px;
}
.pdf-inline-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Loading spinner */
.pdf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  z-index: 2;
  gap: 16px;
}
.pdf-loading p { color: #888; font-size: 14px; }
.pdf-loading.hidden { display: none; }
.pdf-spinner {
  width: 44px; height: 44px;
  border: 4px solid #e8e8e8;
  border-top-color: #3498DB;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .esal-layout { grid-template-columns: 1fr; }
  .esal-sidebar { position: static; }
}
@media (max-width: 768px) {
  .esal-info-grid { grid-template-columns: 1fr; gap: 16px; }
  .page-hero h1 { font-size: 30px; }
  .year-tabs { flex-wrap: wrap; }
  .doc-grid { grid-template-columns: 1fr; }
  .pdf-inline-body { height: 420px; }
  .pdf-inline-btn span { display: none; }
}
