/* Pragya Abhiyan Epaper Custom Stylesheet */

:root {
  --primary-blue: #11366b;
  --primary-blue-light: rgba(17, 54, 107, 0.05);
  --deep-saffron: #f57c00;
  --soft-saffron: #ff9800;
  --saffron-light: rgba(245, 124, 0, 0.08);
  --card-shadow: 0 10px 30px rgba(0,0,0,0.05);
  --hover-shadow: 0 15px 35px rgba(245, 124, 0, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
}

/* Epaper Portal Hero */
.epaper-hero {
  background: linear-gradient(135deg, var(--primary-blue), #1e5ba8);
  color: white;
  padding: 80px 20px;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 15px 30px rgba(17, 54, 107, 0.15);
}

.epaper-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 152, 0, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.epaper-hero h1 {
  font-size: 3.2rem;
  font-weight: 850;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Sidebar Navigation */
.archive-sidebar {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 25px;
  position: sticky;
  top: 100px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.archive-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--saffron-light);
}

.year-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-radius: 10px;
  color: #444;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.25s ease;
  margin-bottom: 6px;
}

.year-link:hover, .year-link.active {
  background-color: var(--saffron-light);
  color: var(--deep-saffron);
  transform: translateX(4px);
}

/* Epaper Grid Cards */
.epaper-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.epaper-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--hover-shadow);
  border-color: rgba(245, 124, 0, 0.2);
}

.epaper-thumb-container {
  position: relative;
  background: #f1f3f5;
  padding-top: 135%; /* Newspaper Aspect Ratio */
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.epaper-thumb-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  background: linear-gradient(180deg, #ffffff 0%, #f1f3f5 100%);
  padding: 20px;
  text-align: center;
}

.epaper-thumb-logo {
  max-width: 90px;
  opacity: 0.85;
  margin-bottom: 15px;
  transition: transform 0.3s ease;
}

.epaper-card:hover .epaper-thumb-logo {
  transform: scale(1.1);
}

.epaper-thumb-date {
  font-weight: 800;
  color: var(--deep-saffron);
  margin-top: 10px;
  font-size: 1.1rem;
}

.epaper-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.epaper-card:hover .epaper-overlay {
  opacity: 1;
}

.epaper-read-btn {
  background: var(--deep-saffron);
  color: white;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 30px;
  border: none;
  box-shadow: 0 4px 15px rgba(245, 124, 0, 0.4);
  transform: translateY(15px);
  transition: all 0.3s ease;
}

.epaper-card:hover .epaper-read-btn {
  transform: translateY(0);
}

.epaper-read-btn:hover {
  background: #e65100;
  color: white;
  box-shadow: 0 6px 20px rgba(245, 124, 0, 0.6);
}

.epaper-card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.epaper-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 12px;
}

/* Fullscreen Epaper Viewer */
.epaper-viewer-container {
  display: flex;
  height: calc(100vh - 70px);
  background: #1e1e1e;
  overflow: hidden;
  position: relative;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Thumbnails Panel */
.epaper-thumbnails-panel {
  width: 240px;
  background: #252526;
  border-right: 1px solid #333333;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 10;
}

.epaper-thumbnails-panel.collapsed {
  transform: translateX(-240px);
  position: absolute;
}

.epaper-thumbnails-header {
  padding: 15px 20px;
  border-bottom: 1px solid #333333;
  color: #e0e0e0;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.epaper-thumbnails-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.epaper-thumb-item {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  background: #1a1a1a;
}

.epaper-thumb-item:hover {
  border-color: #555;
}

.epaper-thumb-item.active {
  border-color: var(--deep-saffron);
  box-shadow: 0 0 10px rgba(245, 124, 0, 0.4);
}

.epaper-thumb-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.epaper-thumb-number {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0,0,0,0.75);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

/* Canvas Area */
.epaper-canvas-area {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 30px;
  position: relative;
  background: #121212;
  user-select: none;
  perspective: 1500px; /* 3D perspective depth */
}

.epaper-canvas-wrapper {
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  background: white;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease;
  border-radius: 4px;
  transform-origin: center center;
  backface-visibility: hidden;
}

/* Page slide transitions */
.epaper-canvas-wrapper.slide-next-out {
  transform: translateX(-80px) scale(0.96);
  opacity: 0;
}
.epaper-canvas-wrapper.slide-next-in {
  transform: translateX(80px) scale(0.96);
  opacity: 0;
  transition: none; /* Instant reset to start position */
}

.epaper-canvas-wrapper.slide-prev-out {
  transform: translateX(80px) scale(0.96);
  opacity: 0;
}
.epaper-canvas-wrapper.slide-prev-in {
  transform: translateX(-80px) scale(0.96);
  opacity: 0;
  transition: none;
}


#epaper-pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Glassmorphism Controls Overlay */
.epaper-controls-overlay {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 25px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 100;
  transition: opacity 0.3s ease;
}

.epaper-control-btn {
  background: transparent;
  border: none;
  color: #e0e0e0;
  font-size: 1.1rem;
  padding: 8px 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.epaper-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--deep-saffron);
}

.epaper-control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.epaper-page-indicator {
  color: #e0e0e0;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 10px;
  border-left: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.15);
}

/* Loading Overlay */
.epaper-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 18, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  color: white;
  transition: opacity 0.3s ease;
}

.epaper-spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border-left-color: var(--deep-saffron);
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile responsive adjustments */
@media(max-width: 768px) {
  .epaper-viewer-container {
    height: calc(100dvh - 65px);
    position: relative;
  }
  .epaper-thumbnails-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.5);
  }
  .epaper-thumbnails-panel.collapsed {
    transform: translateX(-100%);
    position: absolute;
  }
  .epaper-controls-overlay {
    bottom: 80px;
    width: 95%;
    max-width: 480px;
    padding: 6px 12px;
    justify-content: space-between;
    gap: 2px;
  }
  .epaper-control-btn {
    font-size: 0.95rem;
    padding: 6px 8px;
  }
  .epaper-page-indicator {
    font-size: 0.8rem;
    padding: 0 4px;
  }
  .epaper-canvas-area {
    padding: 10px 10px 80px 10px;
  }
}

