/* NightOwl PDF Converter – Premium Dark Redesign */
:root {
  --bg: #0D102A;
  --bg-card: #171B3E;
  --surface: #1E2559;
  --primary: #FFEB3B;
  --primary-hover: #FDD835;
  --text: #FFFFFF;
  --text-muted: #9CA3AF;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Legal pages */
.legal-body .site-header,
.legal-body .legal-page,
.legal-body .site-footer {
  width: min(960px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}
.legal-body .site-header {
  padding-left: 0;
  padding-right: 0;
}
.legal-page {
  max-width: 960px;
  margin-top: 1.25rem;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.legal-page h1 {
  margin-top: 0;
  text-align: center;
  font-size: 2rem;
}
.legal-page > p:first-of-type {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.legal-page h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}
.legal-page p,
.legal-page li {
  color: #e9ebf1;
}
.legal-page ul {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}
.legal-page .ad-slot {
  margin-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

/* Header */
.site-header {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

/* Tool Panels */
.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
}

.logo-link img {
  height: 100px;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.btn-get-app {
  background: var(--primary);
  color: #000 !important;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 1rem 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Main Converter Card */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.converter-card {
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 2rem;
  border: 1px solid var(--border);
  position: relative;
}

/* Tool Tabs (Style like reference) */
.tool-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.tool-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.tool-tab.active {
  color: var(--primary);
  background: rgba(255, 235, 59, 0.1);
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(255, 235, 59, 0.05);
}

.drop-zone .prompt {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.btn-choose {
  background: var(--primary);
  color: #000;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  margin-top: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 235, 59, 0.3);
}

.url-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.url-field {
  width: 100%;
  max-width: 500px;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}

.url-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 235, 59, 0.2);
}

/* File list (after upload) */
.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.file-list .file-name {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list .remove-file {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.file-list .remove-file:hover {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

/* Big Convert button in tool panels */
.tool-panel .actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 0;
}

.tool-panel .actions .btn-primary {
  padding: 1.25rem 2.5rem;
  font-size: 1.25rem;
  min-width: 220px;
}

.convert-status {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
}

/* How to Convert (Horizontal Grid) */
.how-to-section {
  padding: 5rem 1rem;
  text-align: center;
}

.how-to-section h2 {
  font-size: 1.8rem;
  margin-bottom: 3rem;
}

.how-to-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.how-to-step {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-num {
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  border-radius: 50%;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(255, 235, 59, 0.2);
}

.how-to-step h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.how-to-step p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Buttons (shared) */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 15px rgba(255, 235, 59, 0.35);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(255, 235, 59, 0.45);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Result Screen */
.result-screen {
  padding: 3rem;
  text-align: center;
}

.result-message {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 2rem;
}

.result-screen .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.result-screen .btn-primary {
  padding: 1.25rem 2.5rem;
  font-size: 1.25rem;
  min-width: 220px;
}

/* Preparing screen (progress + ads) */
.preparing-screen {
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  border: 1px solid rgba(255, 235, 59, 0.15);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.preparing-content {
  margin-bottom: 0.5rem;
}

@keyframes preparing-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.preparing-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 0 0.35rem 0;
  font-weight: 700;
  letter-spacing: 0.02em;
  animation: preparing-pulse 2s ease-in-out infinite;
}

.preparing-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1.75rem 0;
  font-weight: 400;
}

.progress-dial-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 0 20px rgba(255, 235, 59, 0.25));
}

.progress-dial {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-dial-bg {
  stroke: var(--surface);
  opacity: 0.9;
}

.progress-dial-fill {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s ease-out;
  filter: drop-shadow(0 0 6px rgba(255, 235, 59, 0.4));
}

.progress-dial-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  text-shadow: 0 0 12px rgba(255, 235, 59, 0.3);
}

.ad-container {
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

.ad-preparing {
  min-height: 100px;
  margin-top: 1.5rem;
}

.ad-result {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.ad-footer {
  margin-bottom: 1rem;
  min-height: 50px;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.footer-links a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.site-footer > p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.9;
}

/* Utility */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .how-to-steps {
    grid-template-columns: 1fr;
  }
  .hero h1 { font-size: 2rem; }
  .legal-body .site-header,
  .legal-body .legal-page,
  .legal-body .site-footer {
    width: calc(100% - 1rem);
  }
  .legal-page {
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem;
  }
  .legal-page h1 {
    font-size: 1.6rem;
  }
}
