/* ===================================
   Super Aggregation Tool - Styles
   =================================== */

/* --- CSS Variables / Theme --- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --bg-sidebar: #1a1d23;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #868e96;
  --text-sidebar: #a4a9b4;
  --text-sidebar-active: #ffffff;
  --border-color: #dee2e6;
  --border-light: #e9ecef;
  --accent: #4c6ef5;
  --accent-hover: #3b5bdb;
  --accent-light: #edf2ff;
  --success: #40c057;
  --warning: #fab005;
  --danger: #fa5252;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
  --sidebar-width: 260px;
  --topbar-height: 56px;
  --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, Monaco, monospace;
}

[data-theme="dark"] {
  --bg-primary: #1a1d23;
  --bg-secondary: #212529;
  --bg-tertiary: #2d3238;
  --bg-sidebar: #141619;
  --text-primary: #e9ecef;
  --text-secondary: #adb5bd;
  --text-muted: #6c757d;
  --text-sidebar: #868e96;
  --text-sidebar-active: #ffffff;
  --border-color: #373a40;
  --border-light: #2d3238;
  --accent: #5c7cfa;
  --accent-hover: #4c6ef5;
  --accent-light: #25262b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* --- App Layout --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.logo svg { color: var(--accent); flex-shrink: 0; }

/* Search */
.search-box {
  padding: 12px 16px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition);
}

.search-box input::placeholder { color: var(--text-sidebar); }
.search-box input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.12);
}

.search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sidebar);
  pointer-events: none;
}

/* Nav */
.tool-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-category { margin-bottom: 4px; }

.category-title {
  padding: 8px 20px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
}

.nav-category ul { list-style: none; }

.nav-category li a {
  display: block;
  padding: 7px 20px;
  font-size: 0.875rem;
  color: var(--text-sidebar);
  transition: all var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-category li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.nav-category li a.active {
  color: #fff;
  background: rgba(76,110,245,0.15);
  border-left-color: var(--accent);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 20px;
  font-size: 0.75rem;
  color: #495057;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.top-bar {
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-title {
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
}

.sidebar-toggle { display: none; }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* --- Tool Content --- */
.tool-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.tool-page { display: none; }
.tool-page.active { display: block; }

/* Hero */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #845ef7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.hero-search input {
  width: 100%;
  max-width: 500px;
  padding: 12px 20px;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
}

.hero-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Tool Grid (Home) */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}

.tool-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.tool-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.tool-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Tool Page Common --- */
.tool-header {
  margin-bottom: 24px;
}

.tool-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.tool-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

textarea, input[type="text"], input[type="number"], input[type="url"], select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}

textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868e96' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

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

.btn-secondary:hover { background: var(--border-light); }

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover { opacity: 0.9; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

.btn-xs { padding: 3px 8px; font-size: 0.75rem; }

/* Output Area */
.output-area {
  position: relative;
}

.output-area textarea,
.output-area .output-display {
  background: var(--bg-tertiary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.output-display {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 60px;
  word-break: break-all;
  line-height: 1.5;
}

.output-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

/* --- Specific Tool Styles --- */

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Color Preview */
.color-preview {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: background var(--transition);
}

.color-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.color-value-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.color-value-card .label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.color-value-card .value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
}

/* QR Code */
.qr-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.qr-display {
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-display canvas { display: block; }

/* Diff */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.diff-result {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff-added { background: rgba(64,192,87,0.2); color: var(--success); }
.diff-removed { background: rgba(250,82,82,0.2); color: var(--danger); }

/* Markdown Preview */
.markdown-preview {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  min-height: 200px;
  line-height: 1.7;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 { margin-top: 1em; margin-bottom: 0.5em; }
.markdown-preview code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
.markdown-preview pre { background: var(--bg-tertiary); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.markdown-preview pre code { padding: 0; background: none; }
.markdown-preview blockquote { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--text-secondary); margin: 1em 0; }
.markdown-preview table { border-collapse: collapse; width: 100%; }
.markdown-preview th, .markdown-preview td { border: 1px solid var(--border-color); padding: 8px 12px; text-align: left; }
.markdown-preview th { background: var(--bg-tertiary); }

/* Half grid */
.half-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Range slider */
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

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

.range-row input[type="range"] { flex: 1; }
.range-row .range-value {
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

/* Checkbox row */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* JWT parts */
.jwt-part {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.jwt-part h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.jwt-part pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

/* Image upload */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

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

.upload-zone p { color: var(--text-muted); margin-top: 8px; font-size: 0.85rem; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #212529;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* --- No Results --- */
.no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.no-results .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* --- Sidebar Overlay --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay { display: block; }

  .sidebar-toggle { display: flex; }

  .main-content {
    margin-left: 0;
  }

  .tool-content {
    padding: 20px 16px;
  }

  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.9rem; }

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

  .half-grid,
  .diff-container {
    grid-template-columns: 1fr;
  }

  .qr-container { flex-direction: column; }
  .qr-display canvas { max-width: 100%; }

  .top-bar-title { display: none; }
}

/* ===================================
   v3.0: Simplified Home + Ad Slots
   =================================== */

/* Content wrapper with ad slots */
.content-with-ads {
  display: flex;
  flex: 1;
  gap: 0;
  align-items: flex-start;
}

/* Ad Slots - only visible on desktop tool pages */
.ad-slot {
  width: 160px;
  min-height: 600px;
  flex-shrink: 0;
  padding: 32px 8px;
  position: sticky;
  top: var(--topbar-height);
}

.ad-left { order: 0; }
.ad-right { order: 2; }

.tool-content {
  order: 1;
  flex: 1;
  min-width: 0;
  padding: 32px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

/* When ads are hidden, tool-content takes full width */
.content-with-ads.no-ads .tool-content {
  max-width: 100%;
}

.ad-placeholder {
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px;
}

/* Hide ads on smaller screens */
@media (max-width: 1340px) {
  .ad-slot { display: none !important; }
  .tool-content { max-width: 100% !important; }
}

/* ===================================
   v3.0: Simplified Homepage
   =================================== */

.home-hero-simple {
  text-align: center;
  padding: 48px 20px 24px;
}

.home-hero-simple h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #845ef7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-hero-simple > p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.home-search-big {
  position: relative;
  max-width: 560px;
  margin: 0 auto 32px;
}

.home-search-big svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.home-search-big input {
  width: 100%;
  padding: 14px 24px 14px 52px;
  font-size: 1.05rem;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.home-search-big input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Remove old hero/styles that conflict */
.hero-wrapper, .hero-left, .hero-right, .hero-icon,
.email-card, .email-card-icon, .email-form, .privacy-note,
.hero-features, .hf-item, .hf-icon, .hero-desc, .hero-title,
.hero-search, .section-header {
  display: none;
}

/* --- Top Bar Actions --- */
.top-bar-actions { display: flex; align-items: center; gap: 8px; }

/* --- Language Switcher --- */
.lang-switcher { position: relative; }
.lang-toggle { display: flex; align-items: center; gap: 4px; padding: 4px 8px; font-size: 0.8rem; font-weight: 600; }
.lang-code { font-size: 0.75rem; min-width: 20px; text-align: center; }
.lang-dropdown { display: none; position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 200; min-width: 150px; overflow: hidden; }
.lang-dropdown.show { display: block; }
.lang-dropdown a { display: block; padding: 8px 16px; font-size: 0.85rem; color: var(--text-primary); cursor: pointer; transition: background var(--transition); }
.lang-dropdown a:hover { background: var(--bg-tertiary); color: var(--accent); }
.lang-dropdown a.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* --- Back Navigation --- */
.back-nav { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; margin-bottom: 16px; color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: color var(--transition); text-decoration: none; border-radius: var(--radius-sm); }
.back-nav:hover { color: var(--accent); }

/* --- Tool-specific Styles --- */
.stopwatch-display { text-align: center; padding: 24px; background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius); }
.stopwatch-time { font-family: var(--font-mono); font-size: 3rem; font-weight: 700; letter-spacing: 2px; margin-bottom: 16px; color: var(--accent); }
.stopwatch-laps { max-height: 200px; overflow-y: auto; margin-top: 12px; font-family: var(--font-mono); font-size: 0.85rem; }
.stopwatch-laps div { display: flex; justify-content: space-between; padding: 4px 8px; border-bottom: 1px solid var(--border-light); }

.countdown-display { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: center; }
.countdown-block { background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 20px 12px; }
.countdown-block .cd-value { font-family: var(--font-mono); font-size: 2.5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.countdown-block .cd-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-top: 6px; letter-spacing: 0.05em; }

.todo-input-row { display: flex; gap: 8px; }
.todo-input-row input { flex: 1; padding: 10px 14px; font-size: 0.9rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); outline: none; }
.todo-input-row input:focus { border-color: var(--accent); }
.todo-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.todo-filter { padding: 4px 12px; font-size: 0.8rem; border: 1px solid var(--border-color); border-radius: 20px; background: var(--bg-primary); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
.todo-filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.todo-list { list-style: none; max-height: 350px; overflow-y: auto; }
.todo-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); transition: background var(--transition); }
.todo-list li:hover { background: var(--bg-tertiary); }
.todo-list li.done .todo-text { text-decoration: line-through; color: var(--text-muted); }
.todo-text { flex: 1; font-size: 0.9rem; }
.todo-del { color: var(--danger); cursor: pointer; padding: 2px 6px; border-radius: 4px; opacity: 0; transition: opacity var(--transition); font-size: 1.1rem; }
.todo-list li:hover .todo-del { opacity: 1; }
.todo-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 0.9rem; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; max-height: 400px; overflow-y: auto; }
.emoji-grid span { display: flex; align-items: center; justify-content: center; padding: 8px; font-size: 1.5rem; cursor: pointer; border-radius: var(--radius-sm); transition: background var(--transition); }
.emoji-grid span:hover { background: var(--bg-tertiary); transform: scale(1.2); }
.emoji-category-title { grid-column: 1 / -1; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); padding: 8px 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }

.httptable { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.httptable th { text-align: left; padding: 10px 12px; background: var(--bg-tertiary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 2px solid var(--border-color); }
.httptable td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.httptable .code-col { font-family: var(--font-mono); font-weight: 700; color: var(--accent); white-space: nowrap; width: 70px; }
.httptable tr:hover td { background: var(--bg-tertiary); }

.gradient-preview-box { width: 100%; height: 120px; border-radius: var(--radius); border: 1px solid var(--border-color); transition: background var(--transition); }
.shadow-preview-box { width: 180px; height: 120px; margin: 0 auto; background: var(--bg-primary); border-radius: var(--radius); border: 1px solid var(--border-color); transition: box-shadow var(--transition); }
.seo-output { font-family: var(--font-mono); font-size: 0.8rem; background: var(--bg-tertiary); padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); white-space: pre-wrap; line-height: 1.6; }

.result-highlight { text-align: center; padding: 20px; background: var(--accent-light); border-radius: var(--radius); border: 1px solid var(--accent); }
.result-highlight .big-number { font-size: 3rem; font-weight: 800; color: var(--accent); font-family: var(--font-mono); line-height: 1; display: block; }
.result-highlight .big-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

.cron-desc { background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 16px; font-size: 1rem; line-height: 1.6; }
.cron-next { font-family: var(--font-mono); font-size: 0.85rem; margin-top: 8px; }
.cron-next div { padding: 4px 0; border-bottom: 1px solid var(--border-light); }

.currency-disclaimer { background: #fff3cd; color: #856404; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.8rem; border: 1px solid #ffc107; }
[data-theme="dark"] .currency-disclaimer { background: #3d3200; color: #ffc107; border-color: #856404; }

.ascii-output { font-family: monospace; font-size: 0.55rem; line-height: 1; white-space: pre; overflow-x: auto; background: var(--bg-tertiary); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); min-height: 100px; max-height: 400px; overflow-y: auto; }

/* Calculator */
.calc-display { font-family: var(--font-mono); font-size: 1.8rem; text-align: right; padding: 16px; background: var(--bg-tertiary); border-radius: var(--radius-sm); border: 1px solid var(--border-color); margin-bottom: 12px; min-height: 60px; word-break: break-all; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-btn { padding: 14px; font-size: 1.1rem; font-weight: 600; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); cursor: pointer; transition: all var(--transition); }
.calc-btn:hover { background: var(--bg-tertiary); }
.calc-btn.op { background: var(--accent-light); color: var(--accent); }
.calc-btn.eq { background: var(--accent); color: #fff; }
.calc-btn.wide { grid-column: span 2; }

/* Typing test */
.typing-area { font-family: var(--font-mono); font-size: 1rem; padding: 16px; min-height: 100px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-primary); outline: none; }
.typing-sample { background: var(--bg-tertiary); padding: 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 12px; color: var(--text-secondary); line-height: 1.7; }

/* Image canvas tools */
.canvas-preview { text-align: center; }
.canvas-preview canvas { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }

input:disabled, button:disabled { opacity: 0.6; cursor: not-allowed; }
.logo { cursor: pointer; }
.logo:hover { opacity: 0.8; }

/* --- Responsive V3 --- */
@media (max-width: 1340px) {
  .ad-slot { display: none !important; }
}

@media (max-width: 900px) {
  .home-hero-simple { padding: 32px 16px 16px; }
  .home-hero-simple h1 { font-size: 1.5rem; }
  .home-hero-simple > p { font-size: 0.9rem; }
  .countdown-display { grid-template-columns: repeat(2, 1fr); }
  .countdown-block .cd-value { font-size: 1.8rem; }
  .stopwatch-time { font-size: 2rem; }
}

@media (max-width: 480px) {
  .home-hero-simple h1 { font-size: 1.3rem; }
  .countdown-display { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .countdown-block { padding: 12px 8px; }
  .countdown-block .cd-value { font-size: 1.5rem; }
  .stopwatch-time { font-size: 1.6rem; }
  .calc-btn { padding: 10px; font-size: 0.95rem; }
  .calc-display { font-size: 1.3rem; }
}

/* --- Stopwatch Display --- */
.stopwatch-display {
  text-align: center;
  padding: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.stopwatch-time {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 16px;
  color: var(--accent);
}

.stopwatch-laps {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.stopwatch-laps div {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-light);
}

/* --- Countdown --- */
.countdown-display {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  text-align: center;
}

.countdown-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px 12px;
}

.countdown-block .cd-value {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.countdown-block .cd-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 6px;
  letter-spacing: 0.05em;
}

/* --- To-Do List --- */
.todo-input-row {
  display: flex;
  gap: 8px;
}

.todo-input-row input {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
}

.todo-input-row input:focus { border-color: var(--accent); }

.todo-filters {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.todo-filter {
  padding: 4px 12px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.todo-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.todo-list {
  list-style: none;
  max-height: 350px;
  overflow-y: auto;
}

.todo-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.todo-list li:hover { background: var(--bg-tertiary); }

.todo-list li.done .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-text { flex: 1; font-size: 0.9rem; }

.todo-del {
  color: var(--danger);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--transition);
  font-size: 1.1rem;
}

.todo-list li:hover .todo-del { opacity: 1; }

.todo-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Emoji Grid --- */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
}

.emoji-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.emoji-grid span:hover { background: var(--bg-tertiary); transform: scale(1.2); }

.emoji-category-title {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- HTTP Status Table --- */
.httptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.httptable th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
}

.httptable td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}

.httptable .code-col {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  width: 70px;
}

.httptable tr:hover td { background: var(--bg-tertiary); }

/* --- Gradient Preview --- */
.gradient-preview-box {
  width: 100%;
  height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  transition: background var(--transition);
}

/* --- Box Shadow Preview --- */
.shadow-preview-box {
  width: 180px;
  height: 120px;
  margin: 0 auto;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  transition: box-shadow var(--transition);
}

/* --- Meta SEO Output --- */
.seo-output {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-tertiary);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* --- Age/BMI Result --- */
.result-highlight {
  text-align: center;
  padding: 20px;
  background: var(--accent-light);
  border-radius: var(--radius);
  border: 1px solid var(--accent);
}

.result-highlight .big-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1;
  display: block;
}

.result-highlight .big-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Cron Description --- */
.cron-desc {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 1rem;
  line-height: 1.6;
}

.cron-next {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 8px;
}

.cron-next div {
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
}

/* --- Currency --- */
.currency-disclaimer {
  background: #fff3cd;
  color: #856404;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid #ffc107;
}

[data-theme="dark"] .currency-disclaimer {
  background: #3d3200;
  color: #ffc107;
  border-color: #856404;
}

/* --- ASCII Art --- */
.ascii-output {
  font-family: monospace;
  font-size: 0.55rem;
  line-height: 1;
  white-space: pre;
  overflow-x: auto;
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  min-height: 100px;
  max-height: 400px;
  overflow-y: auto;
}

/* --- Disabled elements --- */
input:disabled, button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Sidebar logo clickable --- */
.logo { cursor: pointer; }
.logo:hover { opacity: 0.8; }

/* --- Responsive V2 --- */
@media (max-width: 900px) {
  .hero-wrapper {
    flex-direction: column;
    gap: 24px;
  }

  .hero-right {
    position: static;
  }

  .hero-features {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .countdown-display {
    grid-template-columns: repeat(2, 1fr);
  }

  .countdown-block .cd-value {
    font-size: 1.8rem;
  }

  .stopwatch-time {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .hero-title { font-size: 1.3rem; }
  .hero-desc { font-size: 0.9rem; }
  .hero-features { gap: 8px; }

  .countdown-display {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .countdown-block { padding: 12px 8px; }
  .countdown-block .cd-value { font-size: 1.5rem; }

  .stopwatch-time { font-size: 1.6rem; }
}
