/* ============================================
   EDESON FILE CONVERTER - MAIN STYLESHEET
   Modern, Responsive, Professional Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ============================================
   CSS Custom Properties (Theming)
   ============================================ */

:root,
[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #1a237e;
  --text-primary: #1a1a2e;
  --text-secondary: #555770;
  --text-muted: #8e8ea0;
  --primary: #1a237e;
  --primary-light: #283593;
  --secondary: #f9a825;
  --accent: #ffffff;
  --success: #4caf50;
  --error: #f44336;
  --warning: #ff9800;
  --info: #2196f3;
  --border: #e0e0e0;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2333;
  --bg-sidebar: #0d1117;
  --text-primary: #ffffff;
  --text-secondary: #b0b8c4;
  --text-muted: #6c757d;
  --primary: #1a237e;
  --primary-light: #283593;
  --secondary: #f9a825;
  --accent: #ffffff;
  --success: #4caf50;
  --error: #f44336;
  --warning: #ff9800;
  --info: #2196f3;
  --border: #30363d;
  --glass-bg: rgba(28, 35, 51, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Reset & Base
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

* {
  transition: var(--transition);
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: 'Poppins', sans-serif;
}

input, select, textarea {
  font-family: 'Poppins', sans-serif;
}

/* ============================================
   Layout - Sidebar
   ============================================ */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar .logo {
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.sidebar .logo-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 10px;
  margin: 4px 12px;
  transition: var(--transition);
  min-height: 44px;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar .nav-link.active {
  background: var(--secondary);
  color: var(--primary);
  font-weight: 600;
}

.sidebar .nav-link i {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar .nav-link span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer span {
  white-space: nowrap;
}

/* ============================================
   Layout - Main Content
   ============================================ */

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* ============================================
   Layout - App Header
   ============================================ */

.app-header {
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border-radius: 0 0 16px 16px;
  animation: headerFadeIn 0.5s ease;
}

@keyframes headerFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.header-main {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: nowrap;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: var(--transition);
}

.header-logo:hover {
  transform: scale(1.05);
}

.header-logo:hover .logo-icon {
  box-shadow: 0 0 20px rgba(249, 168, 37, 0.5);
}

.logo-icon {
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9a825;
  font-size: 1.3rem;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  letter-spacing: -1px;
  border: 2px solid rgba(249, 168, 37, 0.3);
  transition: var(--transition);
  flex-shrink: 0;
}

/* Title Group */
.header-title-group {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.header-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a237e;
  letter-spacing: 1.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
  text-shadow: none;
}

.header-title-group:hover .header-title {
  text-shadow: 0 0 20px rgba(249, 168, 37, 0.3);
}

.header-slogan {
  font-size: 0.75rem;
  font-weight: 400;
  color: #888;
  letter-spacing: 0.5px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Advertisement Banner */
.header-ad {
  flex-shrink: 0;
  width: 468px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}

.ad-link {
  display: block;
  width: 100%;
  height: 100%;
}

.ad-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}

.ad-link:hover .ad-image {
  opacity: 0.9;
  transform: scale(1.02);
}

.ad-placeholder {
  width: 100%;
  height: 100%;
  background: #f8f9fa;
  border: 2px dashed #d0d5dd;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 12px;
}

.ad-placeholder p {
  color: #666;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
}

.ad-placeholder p i {
  color: #1a237e;
  margin-right: 4px;
}

.ad-placeholder .ad-contact {
  color: #888;
  font-size: 0.65rem;
}

.ad-placeholder .ad-whatsapp {
  color: #1a237e;
  font-size: 0.68rem;
  font-weight: 600;
}

.ad-placeholder .ad-whatsapp i {
  color: #25d366;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  background: transparent;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition);
}

.header-icon-btn:hover {
  background: #f9a825;
  color: #1a237e;
  border-color: #f9a825;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 168, 37, 0.3);
}

.header-hamburger {
  display: none;
}

/* Search Bar */
.header-search-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0 24px 14px;
  max-width: 1400px;
  margin: 0 auto;
  animation: searchSlideDown 0.3s ease;
}

.header-search-bar.active {
  display: flex;
}

@keyframes searchSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.header-search-bar i {
  color: #999;
  font-size: 0.9rem;
}

.header-search-bar input {
  flex: 1;
  background: #f5f6fa;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 16px;
  color: #333;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.header-search-bar input:focus {
  border-color: #f9a825;
  box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.15);
}

.search-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #f0f0f0;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: var(--transition);
}

.search-close:hover {
  background: #f44336;
  color: white;
}

/* Header Dark Mode Adjustments */
[data-theme="dark"] .app-header {
  background: #161b22;
  border-bottom-color: #30363d;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .header-title {
  color: #ffffff;
}

[data-theme="dark"] .header-slogan {
  color: #8b949e;
}

[data-theme="dark"] .header-icon-btn {
  border-color: #30363d;
  color: #b0b8c4;
}

[data-theme="dark"] .header-icon-btn:hover {
  background: #f9a825;
  color: #1a237e;
  border-color: #f9a825;
}

[data-theme="dark"] .header-search-bar input {
  background: #0d1117;
  border-color: #30363d;
  color: #e6e6e6;
}

[data-theme="dark"] .ad-placeholder {
  background: #1c2333;
  border-color: #30363d;
}

[data-theme="dark"] .ad-placeholder p {
  color: #b0b8c4;
}

[data-theme="dark"] .ad-placeholder .ad-contact {
  color: #6c757d;
}

[data-theme="dark"] .search-close {
  background: #30363d;
  color: #b0b8c4;
}

/* ============================================
   Sections
   ============================================ */

.section {
  display: none;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section h2 + p,
.section .section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* ============================================
   Dashboard Stats
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.stat-card .stat-icon.blue {
  background: rgba(26, 35, 126, 0.2);
  color: var(--primary);
}

.stat-card .stat-icon.yellow {
  background: rgba(249, 168, 37, 0.2);
  color: var(--secondary);
}

.stat-card .stat-icon.green {
  background: rgba(76, 175, 80, 0.2);
  color: var(--success);
}

.stat-card .stat-icon.red {
  background: rgba(244, 67, 54, 0.2);
  color: var(--error);
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================
   Upload Zone
   ============================================ */

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--secondary);
  background: rgba(249, 168, 37, 0.05);
}

.upload-zone.dragover {
  transform: scale(1.02);
}

.upload-zone .upload-icon {
  font-size: 3rem;
  color: var(--secondary);
  margin-bottom: 16px;
}

.upload-zone h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.upload-zone p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.upload-zone .upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.upload-zone input[type="file"] {
  display: none;
}

/* ============================================
   File Preview Cards
   ============================================ */

.file-preview-area {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.file-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-card .file-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.file-card .file-info {
  flex: 1;
  overflow: hidden;
}

.file-card .file-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card .file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-card .file-remove {
  background: transparent;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition);
}

.file-card .file-remove:hover {
  background: rgba(244, 67, 54, 0.1);
}

.file-card .file-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
}

.file-card .file-status.status-pending {
  background: rgba(255, 152, 0, 0.2);
  color: orange;
}

.file-card .file-status.status-success {
  background: rgba(76, 175, 80, 0.2);
  color: green;
}

.file-card .file-status.status-error {
  background: rgba(244, 67, 54, 0.2);
  color: red;
}

/* ============================================
   Converter Settings Panel
   ============================================ */

.converter-settings {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  margin-top: 20px;
}

.converter-settings h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.setting-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  align-items: center;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.setting-group input[type="text"],
.setting-group input[type="number"],
.setting-group input[type="time"],
.setting-group select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
  min-width: 120px;
}

.setting-group input[type="text"]:focus,
.setting-group input[type="number"]:focus,
.setting-group input[type="time"]:focus,
.setting-group select:focus {
  border-color: var(--secondary);
}

.setting-group input[type="range"] {
  width: 200px;
  accent-color: var(--secondary);
}

.range-value {
  font-size: 0.8rem;
  color: var(--secondary);
  font-weight: 600;
  min-width: 40px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 35, 126, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  filter: brightness(1.1);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-warning {
  background: var(--secondary);
  color: var(--primary);
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ============================================
   Results Area
   ============================================ */

.results-area {
  margin-top: 24px;
}

.results-area h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.result-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  animation: slideUp 0.3s ease;
}

.result-card .result-preview {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.result-card .result-info {
  flex: 1;
}

/* ============================================
   Progress Bar
   ============================================ */

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   Tables
   ============================================ */

.table-container {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.table-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-secondary);
}

.table-actions button:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ============================================
   Tool Cards Grid (PDF Tools)
   ============================================ */

.tool-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.pdf-tool-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.pdf-tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--secondary);
}

.pdf-tool-card i {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 12px;
  display: block;
}

.pdf-tool-card h4 {
  font-size: 0.9rem;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease;
  min-width: 300px;
  max-width: 420px;
  backdrop-filter: blur(12px);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.leaving {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.toast .toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast .toast-message {
  font-size: 0.85rem;
  flex: 1;
}

.toast .toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast.error .toast-icon {
  color: var(--error);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast.info {
  border-left: 4px solid var(--info);
}

.toast.info .toast-icon {
  color: var(--info);
}

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loadingText {
  color: white;
  margin-top: 16px;
  font-size: 0.9rem;
}

/* ============================================
   Info Box
   ============================================ */

.info-box {
  background: rgba(33, 150, 243, 0.1);
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--info);
}

.info-box i {
  margin-top: 2px;
}

/* ============================================
   Settings Page
   ============================================ */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.settings-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
}

.settings-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-card h3 i {
  color: var(--secondary);
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item .setting-label {
  font-size: 0.9rem;
}

.setting-item .setting-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   Toggle Switch
   ============================================ */

.toggle-switch {
  width: 48px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-switch.active {
  background: var(--secondary);
}

.toggle-switch .toggle-knob {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: var(--transition);
}

.toggle-switch.active .toggle-knob {
  transform: translateX(22px);
}

/* ============================================
   About Page
   ============================================ */

.about-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.about-logo {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.5rem;
  color: white;
  font-weight: 700;
}

.about-features {
  text-align: left;
  margin-top: 24px;
}

.about-features li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  color: var(--text-secondary);
}

.about-features li i {
  color: var(--success);
}

/* ============================================
   PDF Tool Area
   ============================================ */

.pdf-tool-area {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
}

.pdf-tool-area h3 {
  margin-bottom: 20px;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--primary);
  color: #ffffff;
  border-radius: 20px 20px 0 0;
  border-top: 3px solid var(--secondary);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  margin-top: 48px;
  overflow: hidden;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  padding: 40px 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section h4 {
  color: var(--secondary);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-section h4 i {
  font-size: 1rem;
}

.footer-name {
  display: inline-block;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 6px;
}

.footer-name:hover {
  color: var(--secondary);
  transform: translateY(-2px);
  display: inline-block;
}

.footer-role {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-top: 4px;
}

.footer-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-link:hover {
  color: var(--secondary);
  transform: translateX(4px);
}

.footer-websites ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-websites ul li {
  margin-bottom: 8px;
}

.footer-websites ul li a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-websites ul li a::before {
  content: '\f0ac';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--secondary);
}

.footer-websites ul li a:hover {
  color: var(--secondary);
  transform: translateX(4px);
}

.footer-bottom {
  text-align: center;
  padding: 16px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.15);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.footer-bottom p i {
  color: var(--secondary);
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   Floating WhatsApp Button
   ============================================ */

.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  z-index: 9999;
  text-decoration: none;
  transition: all 0.3s ease;
  animation: whatsappPulse 2s infinite;
}

.whatsapp-float:hover {
  background: #20bd5a;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.55);
  transform: scale(1.08);
  color: #fff;
}

@keyframes whatsappPulse {
  0% { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(37, 211, 102, 0.65); }
  100% { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4); }
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
}

/* ============================================
   Selection
   ============================================ */

::selection {
  background: var(--secondary);
  color: var(--primary);
}

/* ============================================
   Audio/Video Preview
   ============================================ */

.media-preview {
  width: 100%;
  border-radius: 12px;
  margin-top: 12px;
  background: #000;
}

audio.media-preview {
  height: 50px;
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Sidebar Header
   ============================================ */

.sidebar-header {
  padding: 20px;
}

.sidebar-header .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: block;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

/* ============================================
   Section Headings
   ============================================ */

.section-heading {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-subheading {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* ============================================
   Card Component
   ============================================ */

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   Form Group
   ============================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="time"] {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-group select:focus,
.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="time"]:focus {
  border-color: var(--secondary);
}

.form-group input[type="range"] {
  width: 100%;
  accent-color: var(--secondary);
  margin-top: 4px;
}

.form-group select {
  cursor: pointer;
}

/* ============================================
   Action Buttons
   ============================================ */

.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ============================================
   Resize Inputs
   ============================================ */

.resize-group {
  grid-column: 1 / -1;
}

.resize-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.resize-inputs input[type="number"] {
  width: 120px;
}

.resize-separator {
  color: var(--text-muted);
  font-weight: 500;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--secondary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ============================================
   Trim Inputs
   ============================================ */

.trim-group {
  grid-column: 1 / -1;
}

.trim-inputs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.trim-inputs > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trim-inputs label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   Split Inputs
   ============================================ */

.split-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.split-inputs input[type="number"] {
  width: 120px;
}

/* ============================================
   Button Icon
   ============================================ */

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: 0.85rem;
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-icon-danger:hover {
  color: var(--error);
  background: rgba(244, 67, 54, 0.1);
}

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-image { background: rgba(33, 150, 243, 0.2); color: var(--info); }
.badge-document { background: rgba(76, 175, 80, 0.2); color: var(--success); }
.badge-audio { background: rgba(255, 152, 0, 0.2); color: var(--warning); }
.badge-video { background: rgba(156, 39, 176, 0.2); color: #9c27b0; }
.badge-pdf { background: rgba(244, 67, 54, 0.2); color: var(--error); }
.badge-other { background: rgba(158, 158, 158, 0.2); color: #9e9e9e; }

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-badge.status-success { background: rgba(76, 175, 80, 0.2); color: var(--success); }
.status-badge.status-error { background: rgba(244, 67, 54, 0.2); color: var(--error); }

/* ============================================
   Dashboard Upload Section
   ============================================ */

.dashboard-upload-section {
  margin-bottom: 20px;
}

.dashboard-upload-section .card {
  margin-bottom: 0;
}

/* ============================================
   Privacy Notice Card
   ============================================ */

.privacy-notice-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(33, 150, 243, 0.08);
  border: 1px solid rgba(33, 150, 243, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 32px;
  transition: var(--transition);
}

.privacy-notice-card:hover {
  background: rgba(33, 150, 243, 0.12);
  border-color: rgba(33, 150, 243, 0.4);
}

.privacy-notice-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(33, 150, 243, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #2196f3;
}

.privacy-notice-card-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.privacy-notice-card-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}

.privacy-notice-card-content p:last-child {
  margin-bottom: 0;
}

/* ============================================
   History Page
   ============================================ */

.history-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.history-controls .search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  flex: 1;
  min-width: 200px;
}

.history-controls .search-box i {
  color: var(--text-muted);
  margin-right: 8px;
}

.history-controls .search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  width: 100%;
  font-size: 0.85rem;
}

.history-controls select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.history-table {
  width: 100%;
}

/* ============================================
   Settings Page
   ============================================ */

.settings-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.settings-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-card h2 i {
  color: var(--secondary);
}

.toggle-switch-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  display: block;
  width: 48px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::after {
  content: '';
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: var(--transition);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
  background: var(--secondary);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(22px);
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.privacy-notice p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============================================
   About Page
   ============================================ */

.about-card {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.about-card .about-logo {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.5rem;
  color: white;
}

.about-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-version {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.about-developer {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-developer strong {
  color: var(--secondary);
}

.about-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.about-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: left;
}

.features-list {
  text-align: left;
  margin-bottom: 24px;
}

.features-list li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.features-list li i {
  color: var(--success);
}

.about-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.about-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.about-footer i {
  margin-right: 6px;
  color: var(--secondary);
}

/* ============================================
   PDF Page List (for reorder/remove)
   ============================================ */

.pdf-page-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.pdf-page-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: grab;
  transition: var(--transition);
}

.pdf-page-item:hover {
  border-color: var(--secondary);
}

.pdf-page-item.dragover {
  border-color: var(--secondary);
  background: rgba(249, 168, 37, 0.1);
  transform: scale(1.02);
}

.pdf-page-item .page-handle {
  color: var(--text-muted);
  cursor: grab;
}

.pdf-page-item .page-number {
  font-weight: 600;
  min-width: 40px;
  color: var(--secondary);
}

.pdf-page-item .page-info {
  flex: 1;
  font-size: 0.85rem;
}

.pdf-page-item .page-remove {
  background: transparent;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  transition: var(--transition);
}

.pdf-page-item .page-remove:hover {
  background: rgba(244, 67, 54, 0.1);
}

.pdf-page-item.removed {
  opacity: 0.4;
  text-decoration: line-through;
}

/* ============================================
   Rename Input
   ============================================ */

.rename-group {
  margin-top: 12px;
}

/* ============================================
   PDF Editor
   ============================================ */

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  overflow-x: auto;
}

.editor-tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.editor-separator {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.editor-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.editor-tool-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}

.editor-tool-btn.active {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
  font-weight: 600;
}

.editor-btn-save {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  font-weight: 600;
}

.editor-btn-save:hover {
  background: #43a047;
  border-color: #43a047;
  color: #fff;
}

.editor-btn-close {
  color: var(--error);
}

.editor-btn-close:hover {
  background: rgba(244, 67, 54, 0.1);
  color: var(--error);
}

.editor-page-info {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 8px;
  min-width: 50px;
  text-align: center;
  user-select: none;
}

.editor-page-jump {
  width: 52px;
  height: 30px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  outline: none;
}

.editor-page-jump:focus {
  border-color: var(--secondary);
}

.editor-page-jump::-webkit-inner-spin-button,
.editor-page-jump::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.editor-main {
  display: flex;
  gap: 12px;
  min-height: 500px;
  height: calc(100vh - 260px);
  max-height: 700px;
}

.editor-sidebar {
  width: 160px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease;
}

.editor-sidebar.collapsed {
  width: 44px;
}

.editor-sidebar.collapsed .editor-pages-list,
.editor-sidebar.collapsed .editor-sidebar-actions,
.editor-sidebar.collapsed .editor-sidebar-header h4 {
  display: none;
}

.editor-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.editor-sidebar-header h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.editor-sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.editor-sidebar-toggle:hover {
  color: var(--text-primary);
}

.editor-pages-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-page-thumb {
  position: relative;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: border-color 0.2s ease;
}

.editor-page-thumb:hover {
  border-color: var(--border);
}

.editor-page-thumb.active {
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(249, 168, 37, 0.3);
}

.editor-page-thumb canvas {
  width: 100%;
  display: block;
}

.editor-page-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.65rem;
  text-align: center;
  padding: 2px 0;
}

.editor-sidebar-actions {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-top: 1px solid var(--border);
  justify-content: center;
}

.editor-page-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.editor-page-action:hover {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}

.editor-page-action[title="Delete Page"]:hover {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.editor-canvas-container {
  flex: 1;
  position: relative;
  overflow: auto;
  background: #525659;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  min-width: 0;
}

.editor-canvas-container canvas {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

#editorCanvas {
  position: relative;
  z-index: 1;
}

#editorOverlayCanvas {
  position: absolute;
  z-index: 2;
  cursor: crosshair;
}

#editorTextOverlay {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
}

.editor-text-box {
  position: absolute;
  border: 2px dashed var(--info);
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  font-size: 14px;
  min-width: 60px;
  min-height: 24px;
  outline: none;
  cursor: move;
  resize: both;
  overflow: hidden;
  z-index: 10;
}

.editor-text-box:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(249, 168, 37, 0.3);
}

.editor-text-box.selected {
  border-color: var(--secondary);
}

.editor-properties-panel {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-props-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.editor-props-header h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.editor-props-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.editor-props-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

.editor-prop-group {
  margin-bottom: 12px;
}

.editor-prop-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.editor-prop-group input[type="text"],
.editor-prop-group input[type="number"],
.editor-prop-group select,
.editor-prop-group textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
}

.editor-prop-group input:focus,
.editor-prop-group select:focus,
.editor-prop-group textarea:focus {
  border-color: var(--secondary);
}

.editor-prop-group input[type="color"] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: none;
}

.editor-prop-group input[type="range"] {
  width: 100%;
  accent-color: var(--secondary);
}

.editor-prop-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.editor-prop-row label {
  flex-shrink: 0;
  margin-bottom: 0;
}

.editor-prop-colors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.editor-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.editor-color-swatch:hover,
.editor-color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
}

.editor-brush-sizes {
  display: flex;
  gap: 6px;
  align-items: center;
}

.editor-brush-size {
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.editor-brush-size:hover,
.editor-brush-size.active {
  border-color: var(--secondary);
}

.editor-text-style-btns {
  display: flex;
  gap: 4px;
}

.editor-style-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.editor-style-btn:hover,
.editor-style-btn.active {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}

/* Signature Pad */
.editor-signature-pad-container {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.editor-signature-pad {
  display: block;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

.editor-signature-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Loading animation for editor */
.editor-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  text-align: center;
  color: #fff;
}

.editor-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fullscreen editor */
.editor-main.editor-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  background: var(--bg-primary);
}

.editor-main.editor-fullscreen .editor-canvas-container {
  border-radius: 0;
}

/* ============================================
   App Dev Stats (Hidden Tracker)
   ============================================ */

.app-dev-stats {
  padding: 6px 16px 10px;
  text-align: right;
  font-size: 10px;
  opacity: 0.25;
  color: #999;
  line-height: 1.5;
  pointer-events: none;
  user-select: none;
}

.app-dev-stats.dev-mode {
  opacity: 0.85;
  color: #bbb;
  pointer-events: auto;
  user-select: auto;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  margin: 0 12px 6px;
  padding: 10px 14px;
}

.app-dev-stats .dev-stats-line {
  display: block;
}

.app-dev-stats .dev-stats-divider {
  display: inline-block;
  width: 1px;
  height: 10px;
  background: #666;
  margin: 0 6px;
  vertical-align: middle;
}

/* Editor responsive */
@media (max-width: 992px) {
  .editor-properties-panel {
    width: 180px;
  }
  .editor-sidebar {
    width: 120px;
  }
}

@media (max-width: 768px) {
  .editor-main {
    flex-direction: column;
    height: auto;
    max-height: none;
  }

  .editor-sidebar {
    width: 100%;
    max-height: 120px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .editor-pages-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .editor-page-thumb {
    min-width: 70px;
  }

  .editor-sidebar-actions {
    flex-direction: column;
  }

  .editor-properties-panel {
    width: 100%;
    max-height: 200px;
  }

  .editor-toolbar {
    padding: 6px 8px;
  }

  .editor-tool-btn {
    min-width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
}

/* Responsive styles are in responsive.css */
