@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700;800&display=swap');

/* ===== Global Variables ===== */
:root {
  --primary-bg: #FAF8F5;
  --accent-dark: #0F172A;
  --accent-light: #ffffff;
  --text-muted: #64748B;
  --interactive-color: #C0392B;
  --border-color: #E2DDD5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--primary-bg);
  color: var(--accent-dark);
  min-height: 100vh;
  padding-top: 80px; /* Offset for fixed header */
  overflow-x: hidden;
}

h1, h2, h3, .panel-title {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ===== Header ===== */
.site-header {
  background: rgba(250,248,245,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 40px;
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  z-index: 1000;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform, backdrop-filter;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
}

.logo img {
  height: 50px;
  display: block;
}

.logo {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.nav-buttons {
  display: flex;
  align-items: center;
}

.nav-buttons button {
  margin-left: 12px;
  padding: 10px 22px;
  border-radius: 8px;
  background: transparent;
  color: var(--accent-dark);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
}

.nav-buttons button:hover,
.nav-buttons button.active {
  background: var(--accent-dark);
  color: var(--accent-light);
  border-color: var(--accent-dark);
}

/* ===== Container ===== */
.container {
  display: flex;
  gap: 20px;
  padding: 15px;
  min-height: calc(100vh - 70px);
  flex-wrap: wrap;
}

/* ===== PDF Section ===== */
.pdf-section {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-card {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  position: relative;
}

#pdf-canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.textLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

/* PDF Controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.arrow-btn {
  width: 70px;
  height: 44px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.arrow-btn::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
}

.arrow-btn.prev::before {
  border-width: 10px 14px 10px 0;
  border-color: transparent rgb(0, 0, 0) transparent transparent;
}

.arrow-btn.next::before {
  border-width: 10px 0 10px 14px;
  border-color: transparent transparent transparent rgb(0, 0, 0);
}

.arrow-btn:hover {
  background: #000;
}

.arrow-btn.prev:hover::before {
  border-color: transparent white transparent transparent;
}

.arrow-btn.next:hover::before {
  border-color: transparent transparent transparent white;
}

#pageInfo {
  color: white;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid black;
  padding: 6px 12px;
  border-radius: 6px;
  text-shadow: -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.controls button.fullscreen-btn {
  padding: 10px 16px;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.controls button.fullscreen-btn:hover {
  background: #000;
  color: #fff;
  transform: scale(1.05);
}

.controls button.fullscreen-btn::before {
  content: "\26F6";
  font-size: 18px;
}

/* ===== Right Section ===== */
.right-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 300px;
  max-height: 100%;
}

/* Video Card */
.video-card video {
  width: 100%;
  height: auto;
  max-height: 220px;
  display: block;
  border-radius: 8px;
  border: 3px solid #000;
  box-sizing: border-box;
}

/* ===== Comments ===== */
.comments-card {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}

.comments-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  letter-spacing: 0.3px;
}

#commentList {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  scroll-behavior: smooth;
}

#commentList::-webkit-scrollbar {
  width: 4px;
}

#commentList::-webkit-scrollbar-track {
  background: transparent;
}

#commentList::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

.no-comments {
  text-align: center;
  color: #bbb;
  font-size: 13px;
  padding: 30px 0;
}

.comment {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #f8f9fb;
  border-radius: 12px;
  border-left: 3px solid #667eea;
  word-break: break-word;
  animation: fadeIn 0.3s ease;
  transition: background 0.2s;
}

.comment:hover {
  background: #eef0ff;
}

.comment.pending {
  border-left-color: #ff9800;
  background: #fffbf5;
}

.comment.pending:hover {
  background: #fff5e6;
}

.comment.reply {
  margin-left: 36px;
  border-left-color: #4caf50;
  background: #f5faf5;
}

.comment.reply:hover {
  background: #edf8ed;
}

.comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.comment.reply .comment-avatar {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-body strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 3px;
}

.comment-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #444;
}

.comment-time {
  font-size: 10px;
  color: #aaa;
  margin-top: 5px;
  letter-spacing: 0.2px;
}

/* Input Form */
.comment-input {
  padding: 14px 16px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: #fafbfc;
  border-radius: 0 0 16px 16px;
}

.comment-input textarea {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  font-family: "Segoe UI", Arial, sans-serif;
  border-radius: 10px;
  border: 1.5px solid #e0e0e0;
  outline: none;
  transition: all 0.25s ease;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  background: #fff;
  box-sizing: border-box;
}

.comment-input textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comment-input textarea::placeholder {
  color: #bbb;
}

.comment-input button {
  padding: 9px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.comment-input button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.comment-input button:active {
  transform: translateY(0);
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}