.npdf-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.npdf-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}
.npdf-sidebar {
    background: color-mix(in srgb, var(--color1601) 3%, transparent);
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--color1601) 15%, transparent);
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.npdf-sidebar-header {
  padding-bottom: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--color1601) 15%, transparent);
}

.npdf-sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color1601);
}

.npdf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.npdf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.npdf-item:hover {
  background: rgba(108,92,231,0.05);
  border-color: rgba(108,92,231,0.2);
}

.npdf-item.active {
  background: rgba(108,92,231,0.08);
  border-color: var(--color1602);
}

.npdf-item-icon {
  color: color-mix(in srgb, var(--color1601) 65%, transparent);
  display: flex;
  flex-shrink: 0;
}

.npdf-item.active .npdf-item-icon {
  color: var(--color1602);
}

.npdf-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.npdf-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color1601);
  margin-bottom: 2px;
}

.npdf-path {
  font-size: 11px;
  color: color-mix(in srgb, var(--color1601) 65%, transparent);
  direction: ltr;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== نمایشگر ===== */
.npdf-viewer {
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--color1601) 15%, transparent);
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* نوار ابزار */
.npdf-toolbar {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--color1601) 15%, transparent);
  background: #fafbfc;
  flex-wrap: wrap;
  gap: 12px;
}

.npdf-toolbar-left,
.npdf-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.npdf-file-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--color1601);
}

/* دکمه‌ها */
.npdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--color1601) 15%, transparent);
  background: #fff;
  color: var(--color1601);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  height: 38px;
}

.npdf-btn:hover:not(:disabled) {
  background: #f1f2f6;
  border-color: #c0c7d0;
}

.npdf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.npdf-btn-primary {
  background: var(--color1602);
  border-color: var(--color1602);
  color: #fff;
}

.npdf-btn-primary:hover:not(:disabled) {
  scale: 1.05;
  background: var(--color1602);
}

.npdf-btn svg {
  flex-shrink: 0;
}

/* کانتینر نمایش PDF */
.npdf-viewer-container {
  flex: 1;
  position: relative;
  background: #eef0f4;
  min-height: 70vh;          /* افزایش ارتفاع پیش‌فرض */
}

.npdf-viewer-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: white;
}

/* overlay بارگذاری */
.npdf-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.npdf-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.npdf-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--color1601) 15%, transparent);
    border-top-color: var(--color1602);
    animation: npdf-spin 0.8s linear infinite;
}
@keyframes npdf-spin {
    to { transform: rotate(360deg); }
}
.npdf-status-bar {
    padding: 10px 20px;
    border-top: 1px solid color-mix(in srgb, var(--color1601) 15%, transparent);
    background: #fafbfc;
    font-size: 13px;
    color: color-mix(in srgb, var(--color1601) 65%, transparent);
}
/* دکمه نمایش PDF در موبایل */
.npdf-mobile-view-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;             /* فقط توی کلاس npdf-mobile فعال میشه */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 40px;
  background: color-mix(in srgb, var(--color1602) 80%, #000000);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(108,92,231,0.35);
  transition: transform 0.2s;
  z-index: 10;
}

.npdf-mobile-view-btn:hover {
  transform: translate(-50%, -50%) scale(1.03);
}

/* فقط توی موبایل دکمه رو نشون بده */
.npdf-mobile .npdf-mobile-view-btn {
  display: flex;
}
.npdf-mobile #npdfOpenNewTab {
    display: none !important;
}
/* و iframe رو توی موبایل مخفی کن */
.npdf-mobile iframe {
  display: none;
}

@media (max-width: 1024px) {
    .npdf-container {
        padding: 18px 12px;
        height: auto;
    }
    .npdf-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .npdf-viewer {
        min-height: 80vh;
    }
}
@media (max-width: 640px) {
    .npdf-toolbar {
        padding: 10px 14px;
    }
    .npdf-btn {
        padding: 6px 12px;
        font-size: 12px;
        height: 34px;
    }
}