/* =============================================
   PAGE WRAPPER
   ============================================= */
.page-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* =============================================
   HEADER
   ============================================= */
.headers {
  text-align: center;
  margin-bottom: 30px;
  padding: 35px 25px;
  border-radius: 20px;
  background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
  box-shadow: 0 8px 32px rgba(251, 14, 118, 0.30);
  position: relative;
  overflow: hidden;
}

.headers::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 0%, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.headers-title{
  font-size: 2.5rem !important;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white !important;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.headers-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

.headers-subtitle {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  font-weight: 400;
  max-width: 480px;
  margin: 0 auto;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =============================================
   DROP ZONE
   ============================================= */
.drop-zone {
     border: 2.5px dashed #d07ae8;
    border-radius: 18px;
    background: linear-gradient(135deg, #fdf0ff 0%, #fff0f8 100%);
    padding: 56px 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color .3s, background .3s, box-shadow .3s;
    margin-bottom: 30px;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-hover {
  border-color: var(--grad-start);
  background: #fff0f6;
  box-shadow: 0 0 0 4px rgba(251, 14, 118, 0.08), var(--shadow-md);
  transform: translateY(-2px);
}

.drop-zone.drag-hover {
  border-style: solid;
}

.drop-icon {
  font-size: 3.4rem;
  line-height: 1;
  filter: grayscale(0.2);
  margin-bottom: 4px;
  transition: transform 0.3s;
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-hover .drop-icon {
  transform: scale(1.12) translateY(-3px);
}

.drop-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -4px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
     border: none;
    padding: 14px 28px !important;
    border-radius: 30px !important;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
    transition: .3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(251, 14, 118, 0.42);
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(251, 14, 118, 0.25);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--grad-start);
  color: var(--grad-start);
  box-shadow: none;
  font-size: 12px;
  padding: 10px 22px;
}

.btn-outline:hover {
  background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(251, 14, 118, 0.30);
}

/* =============================================
   LOADING BAR
   ============================================= */
.loading-bar {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.loading-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(251, 14, 118, 0.2);
  border-top-color: var(--grad-start);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* =============================================
   FILE INFO CARD
   ============================================= */
.file-info-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.file-info-top {
     background: #fff;
    border-radius: 18px;
    padding: 28px 26px;
    box-shadow: 0 4px 24px rgba(145, 6, 148, 0.08);
    border: 1px solid rgba(208, 122, 232, 0.18);
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.file-name {
  font-size: 1rem;
  font-weight: 600;
  color: black;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.file-size {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.file-info-bottom {
	margin-top: 8px;
    background: #fff;
    border-radius: 18px;
    padding: 28px 26px;
    box-shadow: 0 4px 24px rgba(145, 6, 148, 0.08);
    border: 1px solid rgba(208, 122, 232, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
 
}

.page-count {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.page-count strong {
  color: var(--grad-start);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: 99px;
  border: 1px solid var(--success-border);
  text-transform: uppercase;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* =============================================
   JSON PREVIEW
   ============================================= */
.json-preview-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-header {
	display: flex;
	    justify-content: space-between;
	border-bottom-right-radius: 0px !important;
border-bottom-left-radius: 0px !important;
    background: #fff;
    border-radius: 12px;
    padding: 28px 26px;
    box-shadow: 0 4px 24px rgba(145, 6, 148, 0.08);
    border: 1px solid rgba(208, 122, 232, 0.18);
}

.preview-title {
  font-size: 1rem;
  font-weight: 700;
  color: black;
  letter-spacing: 0.2px;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
  border: 1.5px solid var(--border);
  border-radius: 12px !important;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  font-size: 1rem;
}

.icon-btn:hover {
  background: linear-gradient(219deg, rgba(251,14,118,0.1) 0%, rgba(145,6,148,0.1) 100%);
  border-color: var(--grad-start);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0);
}

.btn-icon {
  pointer-events: none;
	 font-size:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    line-height:1;
}

.btn-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-family: var(--font);
}

.btn-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text-primary);
}

.icon-btn:hover .btn-tooltip {
  opacity: 1;
}

.json-output {
  padding: 22px 24px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 420px;
  background: #0d0e12;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  line-height: 1.75;
  white-space: pre;
  color: #d4d4d8;
}

.json-output::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.json-output::-webkit-scrollbar-track {
  background: #1a1b22;
}

.json-output::-webkit-scrollbar-thumb {
  background: #3a3b4a;
  border-radius: 3px;
}

.json-output::-webkit-scrollbar-thumb:hover {
  background: #FB0E76;
}

/* JSON Syntax Colors */
.json-key { color: #9ecbff; }
.json-string { color: #a8ff78; }
.json-number { color: #ffb86c; }
.json-boolean { color: #ff79c6; }
.json-null { color: #bd93f9; }
.json-punctuation { color: #8be9fd; }

.preview-footer {
	  background: #fff;
    border-radius: 12px;
    padding: 28px 26px;
    box-shadow: 0 4px 24px rgba(145, 6, 148, 0.08);
    border: 1px solid rgba(208, 122, 232, 0.18);
  display: flex;
  justify-content: space-between;
border-top-left-radius: 0px !important;
	border-top-right-radius: 0px !important;
}

.char-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 320px;
}

.toast.success { background: #14532d; border-left: 4px solid var(--success); }
.toast.error { background: #450a0a; border-left: 4px solid #ef4444; }

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

/* =============================================
   UTILITY
   ============================================= */
.hidden {
  display: none !important;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .page-wrapper {
    padding: 20px 14px 48px;
  }

  .site-header {
    padding: 26px 18px;
    border-radius: 16px;
  }

  .header-title {
    font-size: 1.6rem !important;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.3;
  }

  .header-icon {
    font-size: 1.7rem;
  }

  .header-subtitle {
    font-size: 0.9rem;
  }

  .drop-zone {
    padding: 38px 18px;
    border-radius: 18px;
  }

  .drop-label {
    font-size: 1.05rem;
  }

  .drop-icon {
    font-size: 2.8rem;
  }

  .file-info-top {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .file-name {
    max-width: 230px;
    font-size: 0.9rem;
  }

  .file-info-bottom {
    padding: 12px 16px;
  }

  .preview-header {
    padding: 13px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .json-output {
    padding: 16px;
    font-size: 0.76rem;
    max-height: 300px;
  }

  .preview-footer {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .toast-container {
    bottom: 16px;
    right: 14px;
    left: 14px;
    align-items: stretch;
  }

  .toast {
    max-width: 100%;
    min-width: unset;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .page-wrapper {
    padding: 28px 24px 52px;
  }

  .header-title {
    font-size: 2rem !important;
  }

  .file-name {
    max-width: 280px;
  }
}
