/* FONT */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light Theme */
  --bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --app-bg: #ffffff;
  --text: #1e293b;
  --subtext: #64748b;
  --border: #e2e8f0;
  --input-bg: #f8fafc;
  --slug-bg: #ffffff;
  --slug-hover: #f1f5f9;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #64748b;
  --secondary-hover: #475569;
  --success: #10b981;
  --warning: #f59e0b;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

.dark {
  /* Dark Theme */
  --bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --app-bg: #1e293b;
  --text: #f1f5f9;
  --subtext: #94a3b8;
  --border: #334155;
  --input-bg: #0f172a;
  --slug-bg: #1e293b;
  --slug-hover: #2d3748;
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --secondary: #94a3b8;
  --secondary-hover: #cbd5e1;
  --success: #34d399;
  --warning: #fbbf24;
}

body {
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  padding: 40px 20px;
  transition: background 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

#toggleTheme {
  background: var(--app-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--card-shadow);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#toggleTheme:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
  background: var(--slug-hover);
}

/* App Container */
.app {
  max-width: 900px;
  margin: 0 auto;
  background: var(--app-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--hover-shadow);
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Header */
.app-header {
  padding: 32px 40px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: white;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.logo-icon {
  font-size: 40px;
  background: rgba(255, 255, 255, 0.2);
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.logo-text h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
  color: white;
}

.tagline {
  font-size: 16px;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.9);
}

.header-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-icon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-content {
  display: flex;
  flex-direction: column;
}

.info-title {
  font-weight: 600;
  font-size: 14px;
}

.info-desc {
  font-size: 12px;
  opacity: 0.8;
}

/* Main Content */
.main-content {
  padding: 32px 40px;
  display: grid;
  gap: 32px;
}

/* Section Header */
.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.section-description {
  color: var(--subtext);
  font-size: 14px;
}

/* Input Section */
.input-container {
  background: var(--input-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.3s ease;
}

.input-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.input-header label {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.line-counter {
  font-size: 13px;
  color: var(--subtext);
  background: var(--slug-bg);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}

textarea {
  width: 100%;
  min-height: 180px;
  padding: 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  background: var(--app-bg);
  color: var(--text);
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
}

textarea::placeholder {
  color: var(--subtext);
  opacity: 0.7;
}

.input-footer {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--slug-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--slug-hover);
  border-color: var(--subtext);
}

.btn-primary svg, .btn-secondary svg {
  fill: currentColor;
}

/* Output Section */
.output-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.output-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slug-counter {
  font-size: 13px;
  color: var(--subtext);
  background: var(--slug-bg);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
  border: 1px solid var(--border);
}

/* Result List */
.result-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--subtext);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

/* Slug Item */
.slug-item {
  background: var(--slug-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slug-item:hover {
  background: var(--slug-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
}

.slug-text {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.copy-btn {
  background: var(--app-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.3s ease;
  min-width: 80px;
}

.copy-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.copy-btn:hover svg {
  fill: white;
}

.copy-btn svg {
  width: 16px;
  height: 16px;
  fill: var(--subtext);
  transition: fill 0.3s ease;
}

.copy-btn.copied {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.copy-btn.copied svg {
  fill: white;
}

/* Tips Section */
.tips-section {
  padding: 24px 40px;
  background: var(--input-bg);
  border-top: 1px solid var(--border);
}

.tips-section h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--app-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tip-number {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.tip p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

/* Ad Container */
.ad-container {
  max-width: 900px;
  margin: 24px auto 0;
  padding: 0 20px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 20px 16px;
  }
  
  .app {
    border-radius: var(--radius-md);
  }
  
  .app-header,
  .main-content,
  .tips-section {
    padding: 24px 20px;
  }
  
  .logo-container {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .logo-icon {
    width: 56px;
    height: 56px;
    font-size: 32px;
  }
  
  .logo-text h1 {
    font-size: 28px;
  }
  
  .header-info {
    grid-template-columns: 1fr;
  }
  
  .tips-grid {
    grid-template-columns: 1fr;
  }
  
  .input-footer {
    flex-direction: column;
  }
  
  .output-section .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  #copyAllBtn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .slug-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .copy-btn {
    align-self: flex-start;
  }
}

/* Home Button */
.home-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.home-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--app-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  white-space: nowrap;
}

.home-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
  background: var(--slug-hover);
  border-color: var(--primary);
}

.home-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--text);
  transition: fill 0.3s ease;
}

.home-btn:hover svg {
  fill: var(--primary);
}

.home-text {
  display: inline;
}

/* Theme Toggle positioning adjustment */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

/* Responsive for home button */
@media (max-width: 768px) {
  .home-toggle {
    top: 20px;
    left: 20px;
  }
  
  .home-text {
    display: none;
  }
  
  .home-btn {
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    justify-content: center;
  }
  
  .theme-toggle {
    top: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .home-toggle {
    top: 16px;
    left: 16px;
  }
  
  .theme-toggle {
    top: 16px;
    right: 16px;
  }
  
  .home-btn,
  #toggleTheme {
    width: 42px;
    height: 42px;
  }
}