/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-tertiary: #6b6b6b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --error: #ef4444;
  --border: #333333;
  --border-light: #444444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Top Bar Navigation */
.top-bar {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar .logo {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.top-bar .logo:hover {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

@media (max-width: 768px) {
  .top-bar {
    padding: 1rem 0;
  }

  .top-bar .logo {
    font-size: 1rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-links a {
    font-size: 0.875rem;
  }
}

/* Header */
header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.back-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--success);
  border-radius: 8px;
  color: var(--success);
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

/* Tool Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 3rem 0;
}

.tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.tool-card.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.tool-card.coming-soon:hover {
  transform: none;
}

.tool-icon {
  font-size: 2.5rem;
}

.tool-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.tool-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-grow: 1;
}

.coming-soon-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  align-self: flex-start;
}

/* Converter Page */
.converter-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-description {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg-secondary);
  margin-bottom: 2rem;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.upload-zone h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

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

#videoInput {
  display: none;
}

/* File Info */
.file-info {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
  display: none;
}

.file-info.show {
  display: block;
}

.file-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.file-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.file-info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-info-value {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Settings */
.settings-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: none;
}

.settings-panel.show {
  display: block;
}

.settings-panel h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.setting-group select,
.setting-group input[type="number"] {
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.setting-group select:focus,
.setting-group input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* Video Preview */
.video-preview-container {
  display: none;
  margin-bottom: 2rem;
}

.video-preview-container.show {
  display: block;
}

.video-preview {
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  background: #000;
  border: 1px solid var(--border);
}

/* Trim Controls */
.trim-controls {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: none;
}

.trim-controls.show {
  display: block;
}

.trim-controls h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* Timeline */
.timeline-wrapper {
  margin-bottom: 1.25rem;
  padding: 0 9px;
}

.timeline-track {
  position: relative;
  height: 48px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.timeline-selected {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(59, 130, 246, 0.2);
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
}

.timeline-playhead {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: white;
  z-index: 1;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}

.timeline-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 38px;
  background: var(--accent);
  border-radius: 3px;
  cursor: grab;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.timeline-handle:active {
  cursor: grabbing;
  background: var(--accent-hover);
}

.timeline-handle::before {
  content: '';
  width: 2px;
  height: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 3px 0 0 rgba(255, 255, 255, 0.9), -3px 0 0 rgba(255, 255, 255, 0.9);
}

.timeline-time-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* Time Inputs */
.time-inputs {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.time-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.time-input-group label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.time-input {
  padding: 0.45rem 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  text-align: center;
  width: 100%;
}

.time-input:focus {
  outline: none;
  border-color: var(--accent);
}

.time-input:disabled {
  opacity: 0.5;
}

.time-separator {
  padding-bottom: 1.6rem;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.time-input-duration {
  flex: 0 0 auto;
  min-width: 85px;
}

.time-value {
  display: block;
  padding: 0.45rem 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  text-align: center;
  color: var(--success);
}

/* Progress Bar */
.progress-container {
  margin-bottom: 2rem;
  display: none;
}

.progress-container.show {
  display: block;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
  border-radius: 4px;
  transition: width 0.3s;
  width: 0%;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: #ffffff;
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: #ffffff;
}

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

.button-secondary:hover:not(:disabled) {
  background: var(--bg-tertiary);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Error/Success Messages */
.message {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.message.show {
  display: block;
}

.message-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

.message-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 4rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Quality Slider */
.quality-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
  margin: 0.25rem 0;
}

.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quality-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quality-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.slider-value {
  text-align: center;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

/* About Page */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.about-hero {
  text-align: center;
  padding: 3rem 0 4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.about-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.about-section {
  margin-bottom: 3.5rem;
}

.section-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.about-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.about-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1rem;
}

.tech-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tech-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.tech-item:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.tech-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tech-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cta-section {
  text-align: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 4rem;
}

.cta-section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.cta-section p {
  margin-bottom: 1.5rem;
}

/* Blog Listing */
.blog-hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.blog-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.blog-grid {
  display: grid;
  gap: 2rem;
  padding: 3rem 0 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.blog-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s;
}

.blog-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.blog-card.featured {
  border-color: var(--accent);
  border-width: 2px;
  padding: 2.5rem;
}

.blog-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  align-items: center;
}

.blog-category {
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-card.featured .blog-category {
  background: rgba(59, 130, 246, 0.15);
}

.blog-date {
  color: var(--text-tertiary);
}

.blog-reading-time {
  color: var(--text-tertiary);
}

.blog-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.blog-card h2 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-card h2 a:hover {
  color: var(--accent);
}

.blog-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: gap 0.2s;
}

.read-more:hover {
  gap: 0.5rem;
}

/* Blog Post */
.blog-post {
  padding: 2rem 0 4rem;
}

.blog-post-header {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.blog-post-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.blog-post-lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 1.5rem;
}

.blog-post-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.blog-post-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.blog-post-content h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.blog-post-content p {
  margin-bottom: 1.25rem;
}

.blog-post-content ul,
.blog-post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
}

.blog-post-content li {
  margin-bottom: 0.5rem;
}

.blog-post-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.blog-post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.blog-post-content a:hover {
  border-bottom-color: var(--accent);
}

.blog-post-content .button {
  color: #ffffff;
  border-bottom: none;
}

.blog-post-content .button:hover {
  color: #ffffff;
  border-bottom: none;
}

.blog-post-cta {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.blog-post-cta h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  margin-top: 0;
  color: var(--text-primary);
}

.blog-post-cta p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.blog-post-cta .button {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 1rem;
  }

  .converter-container {
    padding: 2rem 1rem;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .time-inputs {
    flex-wrap: wrap;
  }

  .time-separator {
    display: none;
  }

  .about-hero h1 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1.125rem;
  }

  .tech-stack {
    grid-template-columns: 1fr;
  }

  .blog-hero h1 {
    font-size: 2rem;
  }

  .blog-card {
    padding: 1.5rem;
  }

  .blog-card.featured {
    padding: 2rem;
  }

  .blog-post-header h1 {
    font-size: 1.75rem;
  }

  .blog-post-lead {
    font-size: 1.125rem;
  }

  .blog-post-content {
    font-size: 1rem;
  }

  .blog-post-content h2 {
    font-size: 1.5rem;
  }

  .blog-post-content h3 {
    font-size: 1.2rem;
  }
}
