@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Tool category colors */
  --pdf-color: #ef4444;
  --pdf-bg: #fef2f2;
  --image-color: #8b5cf6;
  --image-bg: #f5f3ff;
  --text-color: #10b981;
  --text-bg: #ecfdf5;
  --util-color: #f59e0b;
  --util-bg: #fffbeb;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0 24px;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

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

.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  color: var(--text);
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary), #7c3aed, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== CATEGORY TABS ===== */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.cat-tab {
  padding: 10px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== TOOLS GRID ===== */
.tools-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.tools-category-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tools-category-title .cat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.tool-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: var(--transition);
}

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

.tool-card:hover::before {
  opacity: 1;
}

.tool-card.pdf-tool::before { background: var(--pdf-color); }
.tool-card.image-tool::before { background: var(--image-color); }
.tool-card.text-tool::before { background: var(--text-color); }
.tool-card.util-tool::before { background: var(--util-color); }

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.pdf-tool .tool-icon { background: var(--pdf-bg); }
.image-tool .tool-icon { background: var(--image-bg); }
.text-tool .tool-icon { background: var(--text-bg); }
.util-tool .tool-icon { background: var(--util-bg); }

.tool-card h3 {
  font-size: 16px;
  font-weight: 700;
}

.tool-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== TOOL PAGE LAYOUT ===== */
.tool-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tool-header {
  text-align: center;
  padding: 48px 24px 32px;
}

.tool-header h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.tool-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

.tool-workspace {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 80px;
  flex: 1;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-white);
  position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.drop-zone h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.drop-zone p {
  font-size: 14px;
  color: var(--text-secondary);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

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

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

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: var(--radius);
}

/* ===== FILE LIST ===== */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-item .file-icon {
  font-size: 20px;
}

.file-item .file-info {
  flex: 1;
}

.file-item .file-name {
  font-size: 14px;
  font-weight: 600;
}

.file-item .file-size {
  font-size: 12px;
  color: var(--text-light);
}

.file-item .file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 18px;
  padding: 4px;
  transition: var(--transition);
}

.file-item .file-remove:hover {
  color: #ef4444;
}

/* ===== ACTIONS BAR ===== */
.actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0;
  flex-wrap: wrap;
}

/* ===== RESULT AREA ===== */
.result-area {
  text-align: center;
  padding: 40px;
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
}

.result-area .success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.result-area h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-area p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
  width: 100%;
  margin: 20px 0;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  border-radius: 100px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
}

/* ===== TEXT TOOL SPECIFIC ===== */
.text-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.text-area-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.text-area-wrapper label {
  font-size: 14px;
  font-weight: 600;
}

.text-area-wrapper textarea {
  width: 100%;
  min-height: 300px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  resize: vertical;
  transition: var(--transition);
  background: var(--bg-white);
  color: var(--text);
  line-height: 1.7;
}

.text-area-wrapper textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  gap: 24px;
  justify-content: center;
  padding: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

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

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== QR CODE ===== */
.qr-input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.qr-input-group input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  transition: var(--transition);
}

.qr-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.qr-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 30px;
}

.qr-result canvas {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-left p {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

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

/* ===== FEATURES SECTION ===== */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.features-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 40px;
  letter-spacing: -0.5px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== OPTIONS PANEL ===== */
.options-panel {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
}

.options-panel h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.option-group label {
  font-size: 14px;
  font-weight: 500;
  min-width: 120px;
}

.option-group select,
.option-group input[type="number"],
.option-group input[type="range"] {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 14px;
}

.option-group select:focus,
.option-group input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== IMAGE PREVIEW ===== */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== COLOR CONVERTER ===== */
.color-display {
  width: 200px;
  height: 200px;
  border-radius: var(--radius);
  margin: 20px auto;
  box-shadow: var(--shadow-md);
  border: 3px solid var(--border);
}

.color-values {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.color-value-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-value-row label {
  font-size: 14px;
  font-weight: 600;
  min-width: 50px;
}

.color-value-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

.color-value-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.color-value-row .copy-btn {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.color-value-row .copy-btn:hover {
  background: var(--primary-light);
}

/* ===== PASSWORD GENERATOR ===== */
.password-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-align: center;
  word-break: break-all;
  letter-spacing: 1px;
  border: 1.5px solid var(--border);
  margin: 20px 0;
}

.password-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.checkbox-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  
  .hero {
    padding: 48px 24px 40px;
  }
  
  .tools-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .text-workspace {
    grid-template-columns: 1fr;
  }
  
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-bar {
    gap: 16px;
  }
}

/* ===== UTILITY CLASSES ===== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.gap-12 { gap: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
