/* CSS Custom Properties for Theme */
:root {
  /* Light Theme Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f4;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --border-color: #e0e0e0;
  --border-hover: #bdbdbd;
  --accent-primary: #007aff;
  --accent-hover: #0056b3;
  --success-color: #34c759;
  --error-color: #ff3b30;
  --warning-color: #fbbc05;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-hover: 0 3px 8px rgba(0,0,0,0.15);
  --shadow-soft: 0 1px 2px rgba(0,0,0,0.05);
  --gradient-primary: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
  --gradient-subtle: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-sm: 12px;
  --line-height: 1.5;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3c3c3c;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-muted: #80868b;
  --border-color: #5f6368;
  --border-hover: #80868b;
  --gradient-primary: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
  --gradient-subtle: linear-gradient(135deg, #2d2d2d 0%, #3c3c3c 100%);
  --accent-primary: #8ab4f8;
  --accent-hover: #aecbfa;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Header */
.header {
  background: var(--gradient-subtle);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  overflow: hidden; /* Prevent overflow on zoom */
}

.logo {
  font-size: 20px;
  font-weight: 600;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text-primary); /* fallback */
  white-space: nowrap; /* Prevent text wrapping on zoom */
  flex-shrink: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
  min-width: 0; /* Allow shrinking */
}

.ad-space-header {
  width: 300px;
  height: 40px;
  background-color: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.donate-btn {
  background-color: var(--accent-primary);
  color: white;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  white-space: nowrap;
}

.donate-btn:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.donate-icon {
  font-size: 14px;
}

.datetime-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.3;
  min-width: 150px;
  flex-shrink: 1;
  gap: 1px;
}

.datetime-current {
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  gap: var(--space-xs);
}

.datetime-epoch {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.epoch-copy-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.epoch-copy-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.epoch-copy-btn.copied {
  background-color: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-hover);
}

/* Main Content */
.main {
  flex: 1;
  padding: var(--space-lg) 0;
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Sidebar Navigation */
.sidebar {
  width: 240px;
  background: var(--gradient-subtle);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}

.sidebar-nav {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: none;
  border: none;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.nav-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  transform: translateX(2px);
}

.nav-btn.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow);
  transform: translateX(4px);
  position: relative;
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: white;
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-text {
  font-weight: 500;
}

/* Main Content Area */
.main {
  flex: 1;
  overflow-x: auto;
  background-color: var(--bg-primary);
}

.main .container {
  max-width: none;
  margin: 0;
  padding: var(--space-lg);
}

/* Tool Container */
.tool-container {
  position: relative;
}

.tool-panel {
  display: none;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.tool-panel.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tool-header {
  background-color: var(--bg-secondary);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Tool Body Layouts */
.tool-body {
  padding: var(--space-lg);
}

.side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.full-width {
  width: 100%;
}

/* Panel Styles */
.input-panel, .output-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
}

.input-panel {
  flex: 1;
}

.output-panel {
  flex: 1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-controls {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.panel-header label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Form Elements */
textarea, input[type="text"] {
  width: 100%;
  min-height: 500px;
  padding: var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  resize: vertical;
  transition: border-color 0.2s ease;
}

/* String converter specific textarea */
#string-converter textarea {
  min-height: 150px;
}

#jwt-decoder #jwtInput {
  min-height: 100px;
  height: 100px;
  resize: vertical;
}

input[type="text"] {
  min-height: auto;
  height: 40px;
  resize: none;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

textarea::placeholder, input[type="text"]::placeholder {
  color: var(--text-muted);
}

/* Button Styles */
.btn-primary, .btn-secondary, .copy-btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-soft);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
  font-weight: 600;
}

.btn-secondary:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.copy-btn {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
  font-size: var(--font-size-base);
  font-weight: bold;
  padding: var(--space-xs) var(--space-sm);
}

.copy-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.copy-btn.copied {
  background-color: var(--success-color);
  color: white;
  border-color: var(--success-color);
  animation: pulse 0.4s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.btn-tree-toggle {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tree-toggle:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-tree-toggle.active {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* JSON Tree View Styles */
.json-tree {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  height: 500px;
  min-height: 500px;
  max-height: 500px;
  overflow-y: auto;
  flex-shrink: 0;
}

.json-node {
  margin: 2px 0;
}

.json-key {
  color: var(--accent-primary);
  font-weight: 500;
  transition: color 0.2s ease;
}

.json-key:hover {
  color: var(--accent-hover);
}

.json-value {
  color: var(--text-primary);
}

.json-value.string {
  color: #22c55e;
}

.json-value.number {
  color: #f59e0b;
}

.json-value.boolean {
  color: #8b5cf6;
}

.json-value.null {
  color: var(--text-muted);
  font-style: italic;
}

.json-toggle {
  display: inline-block;
  width: 16px;
  height: 16px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  font-weight: bold;
  margin-right: var(--space-xs);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.json-toggle:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.json-toggle.expanded::before {
  content: '▼';
}

.json-toggle.collapsed::before {
  content: '▶';
}

.json-toggle.empty::before {
  content: '•';
  opacity: 0.5;
}

.json-children {
  margin-left: var(--space-lg);
  padding-left: var(--space-md);
}

.json-children.collapsed {
  display: none;
}

.json-bracket {
  color: var(--text-secondary);
  font-weight: bold;
}

.json-comma {
  color: var(--text-secondary);
}

.json-count {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin-left: var(--space-sm);
}

/* Case Grid for String Converter */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.case-output {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* New Tool Styles */

/* Select Elements */
.version-select, .quantity-select, .separator-select, .case-select, .timezone-select {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.version-select:hover, .quantity-select:hover, .separator-select:hover, .case-select:hover, .timezone-select:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-tertiary);
}

/* UUID Generator Styles */
.uuid-controls {
  margin-bottom: var(--space-md);
}

.uuid-copy-options {
  display: flex;
  gap: var(--space-xs);
}

.uuid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.uuid-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

.uuid-text {
  flex: 1;
  color: var(--text-primary);
  user-select: all;
}

.uuid-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-xl);
  font-style: italic;
}

/* Timestamp Converter Styles */
.timestamp-inputs, .timestamp-outputs {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.input-group, .output-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.input-group label, .output-group label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.input-group input, .output-group input {
  min-height: auto;
  height: 40px;
  font-family: var(--font-mono);
}

.input-divider {
  text-align: center;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-size-sm);
  padding: var(--space-md) 0;
  position: relative;
  margin: var(--space-sm) 0;
}

.input-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--border-color);
  z-index: 1;
}

.input-divider::after {
  content: 'OR';
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  padding: 0 var(--space-md);
  position: relative;
  z-index: 2;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.output-field {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.output-field input {
  flex: 1;
}

.output-field .copy-btn {
  flex-shrink: 0;
}

.input-help {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-xs);
  font-style: italic;
}

.output-section {
  margin-bottom: var(--space-lg);
}

.output-section:last-child {
  margin-bottom: 0;
}

.output-section h4 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-color);
}

/* Slug Generator Styles */
#slug-generator textarea {
  min-height: 120px;
}

#slug-generator .output-panel {
  margin-top: var(--space-md);
}

#slug-generator input[type="text"] {
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--accent-primary);
}

/* HTML Escaper Styles - uses existing side-by-side layout */

/* JWT Decoder Styles */
.jwt-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.jwt-section {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.jwt-section textarea {
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

.claims-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.claim-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.claim-item label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.claim-item input {
  height: 36px;
  font-family: var(--font-mono);
}

/* Regex Tester Styles */
.regex-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.regex-pattern-group, .regex-test-group {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.regex-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.regex-input-group input {
  height: 40px;
  font-family: var(--font-mono);
}

.regex-flags {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.regex-flags label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: pointer;
}

.regex-flags input[type="checkbox"] {
  width: auto;
  height: auto;
  min-height: auto;
}

.regex-test-group textarea {
  min-height: 120px;
  font-family: var(--font-mono);
}

.regex-results {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.regex-output {
  min-height: 120px;
  padding: var(--space-md);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  white-space: pre-wrap;
  overflow-y: auto;
  margin-top: var(--space-sm);
}

.regex-match {
  background-color: var(--accent-primary);
  color: white;
  padding: 1px 2px;
  border-radius: 2px;
}

/* Color Converter Styles */
.color-preview {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.color-swatch {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
              linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  flex-shrink: 0;
}

.color-info {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
}

.color-formats {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.color-format-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.color-format-group label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.color-input-group {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.color-input-group input {
  flex: 1;
  height: 40px;
  font-family: var(--font-mono);
}

/* Markdown Preview Styles */
.markdown-preview {
  min-height: 300px;
  padding: var(--space-lg);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-y: auto;
  font-family: var(--font-primary);
  line-height: 1.6;
}

.markdown-preview h1 {
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--space-sm);
  margin-top: 0;
  margin-bottom: var(--space-md);
}

.markdown-preview h2 {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-xs);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
}

.markdown-preview h3 {
  color: var(--text-primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.markdown-preview blockquote {
  border-left: 4px solid var(--accent-color);
  margin: var(--space-md) 0;
  padding: 0 var(--space-md);
  color: var(--text-secondary);
  font-style: italic;
}

.markdown-preview code {
  background: var(--bg-secondary);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text-primary);
}

.markdown-preview pre {
  background: var(--bg-secondary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-md) 0;
}

.markdown-preview pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.9em;
}

.markdown-preview ul,
.markdown-preview ol {
  padding-left: var(--space-lg);
  margin: var(--space-md) 0;
}

.markdown-preview li {
  margin: var(--space-xs) 0;
}

.markdown-preview a {
  color: var(--accent-color);
  text-decoration: none;
}

.markdown-preview a:hover {
  text-decoration: underline;
}

.markdown-preview p {
  margin: var(--space-md) 0;
}

/* Hash Generator Styles */
.hash-outputs {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.hash-output-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.hash-output-group label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.hash-field {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.hash-field input {
  flex: 1;
  height: 40px;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-sm);
  color: var(--text-primary);
}

.hash-field .copy-btn {
  flex-shrink: 0;
}

/* Human Readable DateTime Fields */
.datetime-fields {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.date-group, .time-group, .timezone-group {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.datetime-fields input[type="text"] {
  width: auto;
  min-width: 35px;
  max-width: 50px;
  height: 28px;
  padding: var(--space-xs);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 500;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.datetime-fields input[type="text"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.datetime-fields input[type="text"]:invalid {
  border-color: var(--error-color);
  background-color: rgba(234, 67, 53, 0.05);
}

.datetime-fields input[type="text"].error {
  border-color: var(--error-color);
  background-color: rgba(234, 67, 53, 0.05);
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.datetime-fields .separator {
  color: var(--text-secondary);
  font-weight: 500;
  user-select: none;
}

.timezone-group input {
  min-width: 60px;
}

.timezone-group select,
.timezone-select {
  min-width: 60px;
  height: 28px;
  padding: var(--space-xs);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='5'><path fill='%235f6368' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}

[data-theme="dark"] .timezone-group select,
[data-theme="dark"] .timezone-select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='5'><path fill='%239aa0a6' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
}

.datetime-fields .copy-btn {
  margin-left: auto;
}

/* Responsive adjustments for new tools */
@media (max-width: 768px) {
  .uuid-grid {
    grid-template-columns: 1fr;
  }
  
  .timestamp-inputs, .timestamp-outputs {
    gap: var(--space-sm);
  }
  
  .output-field {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
  }
  
  .tool-actions {
    flex-wrap: wrap;
    gap: var(--space-xs);
  }
  
  .datetime-fields {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
  }
  
  .date-group, .time-group, .timezone-group {
    justify-content: center;
  }
  
  .version-select, .quantity-select, .separator-select, .case-select, .timezone-select {
    font-size: var(--font-size-sm);
    padding: var(--space-xs) var(--space-sm);
  }
}

/* Status Bar */
.status-bar {
  padding: var(--space-sm) var(--space-lg);
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  transition: all 0.3s ease;
}

.status-bar .status-success {
  color: var(--success-color);
  font-weight: 500;
}

.status-bar .status-error {
  color: var(--error-color);
  font-weight: 500;
}

/* Sidebar Ad Space */
.sidebar-ad {
  position: fixed;
  right: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  height: 600px;
  background-color: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  z-index: 10;
}

/* Header responsiveness for zoom and small screens */
@media (max-width: 1400px) {
  .ad-space-header {
    display: none;
  }
  
  .header-controls {
    gap: var(--space-sm);
  }
  
  .datetime-display {
    min-width: 130px;
    font-size: calc(var(--font-size-sm) * 0.9);
  }
}

@media (max-width: 1000px) {
  .header .container {
    padding: 0 var(--space-md);
  }
  
  .logo {
    font-size: calc(var(--font-size-xl) * 0.9);
  }
  
  .datetime-display {
    min-width: 110px;
  }
  
  .theme-toggle {
    width: 36px;
    height: 36px;
    padding: var(--space-xs);
  }
}

@media (max-width: 800px) {
  .datetime-display {
    display: none;
  }
  
  .header-controls {
    gap: var(--space-xs);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .sidebar-ad {
    display: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
  
  .side-by-side {
    grid-template-columns: 1fr;
  }
  
  .tool-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }
  
  .tool-actions {
    justify-content: center;
  }
  
  .case-grid {
    grid-template-columns: 1fr;
  }
  
  .main-layout {
    flex-direction: column;
    flex: 1;
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: var(--space-xs);
    padding: var(--space-sm);
  }
  
  .nav-btn {
    flex-shrink: 0;
    min-width: 120px;
    padding: var(--space-sm) var(--space-md);
  }
  
  .nav-btn:hover,
  .nav-btn.active {
    transform: none;
  }
  
  .nav-btn.active::before {
    display: none;
  }
  
  .nav-text {
    font-size: var(--font-size-sm);
  }
  
  .main .container {
    padding: var(--space-md);
  }
  
  .ad-space-header {
    width: 200px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }
  
  /* Hash Generator Mobile */
  .hash-outputs {
    gap: var(--space-sm);
  }
  
  .hash-field input {
    font-size: var(--font-size-xs);
  }
  
  /* QR Generator Mobile */
  .qr-code-container {
    gap: var(--space-sm);
  }
  
  /* Markdown Preview Mobile */
  .markdown-preview {
    padding: var(--space-sm);
    min-height: 250px;
  }
  
  /* Input Divider Mobile */
  .input-divider {
    margin: var(--space-sm) 0;
    font-size: var(--font-size-xs);
  }
}

/* QR Code Generator Styles */
.qr-preview {
  margin-top: var(--space-md);
  display: flex;
  justify-content: center;
}

.qr-code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.qr-code {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.qr-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Markdown Preview Styles */
.markdown-preview {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  min-height: 300px;
  overflow-y: auto;
  font-family: var(--font-primary);
  line-height: 1.6;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.markdown-preview h1 { font-size: 2rem; }
.markdown-preview h2 { font-size: 1.5rem; }
.markdown-preview h3 { font-size: 1.25rem; }

.markdown-preview p {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.markdown-preview code {
  background-color: var(--bg-secondary);
  color: var(--accent-primary);
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.markdown-preview pre {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  overflow-x: auto;
  margin-bottom: var(--space-sm);
}

.markdown-preview pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.markdown-preview blockquote {
  border-left: 4px solid var(--accent-primary);
  padding-left: var(--space-sm);
  margin: var(--space-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.markdown-preview ul,
.markdown-preview ol {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-lg);
}

.markdown-preview li {
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.markdown-preview a {
  color: var(--accent-primary);
  text-decoration: none;
}

.markdown-preview a:hover {
  text-decoration: underline;
}

.markdown-preview strong {
  font-weight: 600;
  color: var(--text-primary);
}

.markdown-preview em {
  font-style: italic;
}

/* View Toggle Button Styles */
.btn-text-view,
.btn-tree-view {
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: white;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px; /* Larger for better emoji rendering */
  min-width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Emoji', sans-serif;
  line-height: 1;
}

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

.btn-text-view:hover {
  background-color: #f8fafc;
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-text-view.active {
  background-color: #3b82f6;
  border-color: #2563eb;
  color: white;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-tree-view {
  background-color: white;
  border-color: var(--border-color);
  color: var(--text-primary);
  position: relative;
}

.btn-tree-view:hover {
  background-color: #f8fafc;
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-tree-view.active {
  background-color: #3b82f6;
  border-color: #2563eb;
  color: white;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Improve tree emoji appearance */
.btn-tree-view {
  filter: brightness(1.1) contrast(1.1);
}

/* Dark mode adjustments */
[data-theme="dark"] .btn-text-view {
  background-color: #2563eb;
  border-color: #1d4ed8;
}

[data-theme="dark"] .btn-text-view:hover {
  background-color: #1d4ed8;
  border-color: #1e40af;
}

[data-theme="dark"] .btn-text-view.active {
  background-color: #1e40af;
  border-color: #1e3a8a;
}

[data-theme="dark"] .btn-tree-view {
  background-color: #059669;
  border-color: #047857;
}

[data-theme="dark"] .btn-tree-view:hover {
  background-color: #047857;
  border-color: #065f46;
}

[data-theme="dark"] .btn-tree-view.active {
  background-color: #065f46;
  border-color: #064e3b;
}

/* Input Divider Styles */
.input-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--space-md) 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.input-divider::before,
.input-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.input-divider::before {
  margin-right: var(--space-sm);
}

.input-divider::after {
  margin-left: var(--space-sm);
}

/* Scrollbar Styles */
textarea::-webkit-scrollbar, input::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

textarea::-webkit-scrollbar-track, input::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

textarea::-webkit-scrollbar-thumb, input::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}

textarea::-webkit-scrollbar-thumb:hover, input::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  flex-shrink: 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.made-by {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.contact-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tool-panel.active {
  animation: fadeIn 0.3s ease;
}

/* Error/Success States */
.error {
  border-color: var(--error-color) !important;
}

.success {
  border-color: var(--success-color) !important;
}

.status-error {
  color: var(--error-color);
}

.status-success {
  color: var(--success-color);
}

.status-warning {
  color: var(--warning-color);
}