/**
 * ONE RESIZER — Tool 14: PDF Rotate Pages Stylesheet
 * Native PDF Page Rotation (/Rotate Metadata), Interactive Thumbnail Grid,
 * Live Rotated Stage Preview, 90° / 180° Controls, and Responsive Studio Layout.
 */

/* ========================================================
   CONTAINER & WORKSPACE VIEWS
   ======================================================== */
.pdfr-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pdfr-view {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.pdfr-view.hidden {
  display: none !important;
}

/* ========================================================
   UPLOAD HERO SCREEN
   ======================================================== */
.upload-hero-card {
  background: var(--bg-card);
  border: 2px dashed var(--primary-cyan);
  border-radius: var(--radius-xl);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.upload-hero-card:hover, .upload-hero-card.dragover {
  background: rgba(22, 135, 245, 0.08);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.upload-icon-wrapper {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: rgba(22, 135, 245, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
}
.upload-icon-wrapper svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  fill: none;
}

.upload-heading {
  font-size: 20px;
  font-weight: 850;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.upload-subheading {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.upload-btn-fake {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-cyan);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  padding: 9px 22px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px var(--primary-glow);
  margin-bottom: 14px;
  transition: var(--transition);
}
.upload-btn-fake:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}
.upload-formats-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 5px 14px;
  border-radius: var(--radius-full);
}

/* ========================================================
   WORKSPACE 2-COLUMN STUDIO LAYOUT
   ======================================================== */
.pdfr-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .pdfr-studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Column: Controls & Thumbnails */
.pdfr-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

/* Mini File Bar */
.pdfr-file-mini-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.pdfr-mini-info {
  min-width: 0;
}
.pdfr-mini-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.pdfr-mini-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.pdfr-btn-change {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 750;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.pdfr-btn-change:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* Target Scope Selector (Current vs Selected vs All) */
.pdfr-scope-section {
  margin-bottom: 16px;
}
.pdfr-section-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 6px;
  display: block;
}
.pdfr-scope-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 4px;
}
.pdfr-scope-tab {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.pdfr-scope-tab:hover {
  color: var(--text-heading);
}
.pdfr-scope-tab.active {
  background: var(--bg-card);
  color: var(--primary-cyan);
  box-shadow: var(--shadow-sm);
}

/* Rotation Action Buttons */
.pdfr-rot-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.pdfr-rot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text-heading);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 800;
  font-size: 12px;
}
.pdfr-rot-btn:hover {
  background: rgba(22, 135, 245, 0.08);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  transform: translateY(-1px);
}
.pdfr-rot-icon {
  font-size: 18px;
}

/* Thumbnails Strip */
.pdfr-thumbs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pdfr-thumbs-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-heading);
}
.pdfr-thumbs-actions {
  display: flex;
  gap: 6px;
}
.pdfr-btn-mini {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.pdfr-btn-mini:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

.pdfr-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  box-sizing: border-box;
}

.pdfr-thumb-card {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pdfr-thumb-card:hover {
  border-color: rgba(22, 135, 245, 0.4);
}
.pdfr-thumb-card.active-page {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 2px rgba(22, 135, 245, 0.3);
}
.pdfr-thumb-card.selected {
  background: rgba(22, 135, 245, 0.08);
}

.pdfr-thumb-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  z-index: 2;
}
.pdfr-thumb-card.selected .pdfr-thumb-check {
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  color: #fff;
}

.pdfr-thumb-preview-box {
  width: 100%;
  height: 80px;
  background: #fff;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.pdfr-thumb-preview-box canvas {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.2s ease;
}

.pdfr-thumb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}
.pdfr-rot-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9.5px;
  color: var(--primary-cyan);
}

/* Reset / Clear Button */
.pdfr-btn-reset-rot {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
}
.pdfr-btn-reset-rot:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Action Button */
.pdfr-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: var(--transition);
}
.pdfr-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--primary-glow);
}
.pdfr-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Progress Bar */
.pdfr-progress-card {
  margin-top: 18px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: none;
}
.pdfr-progress-card.active {
  display: block;
}
.pdfr-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.pdfr-progress-track {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.pdfr-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-cyan), #10b981);
  transition: width 0.2s ease;
}

/* Results Card */
.pdfr-results-card {
  margin-top: 20px;
  padding: 22px;
  border: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.06);
  border-radius: var(--radius-xl);
  display: none;
}
.pdfr-results-card.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
.pdfr-results-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16.5px;
  font-weight: 900;
  color: #10b981;
  margin-bottom: 14px;
}
.pdfr-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 550px) {
  .pdfr-metrics-grid {
    grid-template-columns: 1fr;
  }
}
.pdfr-metric-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
}
.pdfr-metric-label {
  font-size: 11px;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}
.pdfr-metric-value {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-heading);
}

.pdfr-download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: #10b981;
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
  margin-bottom: 10px;
}
.pdfr-download-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}
.pdfr-btn-secondary {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-heading);
  font-size: 12px;
  font-weight: 750;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.pdfr-btn-secondary:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* Right Column: Live Interactive Stage Preview */
.pdfr-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pdfr-preview-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pdfr-preview-title {
  font-size: 14px;
  font-weight: 850;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdfr-preview-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdfr-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-heading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition);
}
.pdfr-nav-btn:hover:not(:disabled) {
  background: var(--primary-cyan);
  color: #fff;
  border-color: var(--primary-cyan);
}
.pdfr-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pdfr-nav-counter {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.pdfr-canvas-stage {
  width: 100%;
  max-width: 460px;
  min-height: 460px;
  background: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.08);
}
.pdfr-preview-canvas {
  max-width: 100%;
  max-height: 500px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  border-radius: 4px;
  background: #fff;
  transition: transform 0.2s ease;
}
