/* DevTools Pro - Main Stylesheet */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --accent: #0d6efd;
  --accent-hover: #0b5ed7;
  --success: #198754;
  --error: #dc3545;
  --warning: #ffc107;
  --border: #dee2e6;
  --shadow: rgba(0, 0, 0, 0.1);
  --code-bg: #f4f4f4;
  --radius: 8px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --text-primary: #eaeaea;
  --text-secondary: #a0a0a0;
  --accent: #4dabf7;
  --accent-hover: #74c0fc;
  --border: #2d3748;
  --shadow: rgba(0, 0, 0, 0.3);
  --code-bg: #0d1117;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo svg {
  width: 32px;
  height: 32px;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

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

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--accent);
  color: white;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Main Content */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 1rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-radius: var(--radius);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

/* Code Pattern Background */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='5' y='20' font-family='monospace' font-size='10' fill='%230d6efd' opacity='0.08'%3E%7B%7D%3C/text%3E%3Ctext x='45' y='40' font-family='monospace' font-size='8' fill='%239333ea' opacity='0.06'%3E%3C/%3E%3C/text%3E%3Ctext x='15' y='60' font-family='monospace' font-size='9' fill='%230d6efd' opacity='0.05'%3E()%3C/text%3E%3Ctext x='55' y='75' font-family='monospace' font-size='7' fill='%239333ea' opacity='0.07'%3E[]%3C/text%3E%3C/svg%3E");
  animation: codeScroll 30s linear infinite;
  pointer-events: none;
}

@keyframes codeScroll {
  0% { background-position: 0 0; }
  100% { background-position: 80px 80px; }
}

/* Gradient Orbs */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 60% 50% at 10% 20%, rgba(13, 110, 253, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 90% 80%, rgba(147, 51, 234, 0.12) 0%, transparent 50%);
  pointer-events: none;
  animation: orbPulse 10s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Floating Terminal Decoration */
.terminal-decoration {
  position: absolute;
  top: 15%;
  left: 5%;
  width: 80px;
  height: 60px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  opacity: 0.3;
  animation: termFloat 12s ease-in-out infinite;
}

.terminal-decoration::before {
  content: '$ _';
  position: absolute;
  top: 25%;
  left: 10px;
  font-family: monospace;
  font-size: 10px;
  color: var(--accent);
  animation: cursorBlink 1s step-end infinite;
}

@keyframes termFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-15px) rotate(3deg); }
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent), #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

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

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

.tool-card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  position: relative;
  transition: all 0.3s ease;
}

/* Gradient variants for different tools */
.tool-card[data-tool="json"] .tool-card-icon {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.tool-card[data-tool="base64"] .tool-card-icon {
  background: linear-gradient(135deg, #0d6efd, #0ea5e9);
}

.tool-card[data-tool="hash"] .tool-card-icon {
  background: linear-gradient(135deg, #10b981, #14b8a6);
}

.tool-card[data-tool="uuid"] .tool-card-icon {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.tool-card[data-tool="regex"] .tool-card-icon {
  background: linear-gradient(135deg, #ef4444, #f43f5e);
}

.tool-card[data-tool="url"] .tool-card-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.tool-card[data-tool="minify"] .tool-card-icon {
  background: linear-gradient(135deg, #84cc16, #22c55e);
}

.tool-card[data-tool="sql"] .tool-card-icon {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 8px 25px -5px currentColor;
}

/* Subtle shine effect */
.tool-card-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.tool-card:hover .tool-card-icon::after {
  left: 100%;
}

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

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

/* Tool Page Layout */
.tool-header {
  margin-bottom: 2rem;
}

.tool-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tool-header p {
  color: var(--text-secondary);
}

.tool-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .tool-container {
    grid-template-columns: 1fr;
  }
}

.tool-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

.textarea-wrapper {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 350px;
  padding: 1rem;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
}

textarea::placeholder {
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

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

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

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

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
}

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

/* Action Bar */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Options Panel */
.options-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

select, input[type="text"], input[type="number"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

select:focus, input:focus {
  border-color: var(--accent);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

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

.toast.success {
  background: var(--success);
  color: white;
}

.toast.error {
  background: var(--error);
  color: white;
}

/* Status Indicator */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-valid {
  background: rgba(25, 135, 84, 0.1);
  color: var(--success);
}

.status-invalid {
  background: rgba(220, 53, 69, 0.1);
  color: var(--error);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

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

/* Ad Placeholder */
.ad-container {
  background: var(--bg-tertiary);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  margin: 2rem 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  color: var(--text-secondary);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .nav.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-bar .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Regex Tester Specific */
.regex-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.regex-input-group input {
  flex: 1;
  min-width: 200px;
}

.flags-group {
  display: flex;
  gap: 0.25rem;
}

.flag-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: monospace;
  border-radius: var(--radius);
  transition: all var(--transition);
}

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

.match-highlight {
  background: rgba(13, 110, 253, 0.3);
  border-radius: 2px;
}

/* Hash output */
.hash-results {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.hash-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  gap: 1rem;
  align-items: center;
}

.hash-row:last-child {
  border-bottom: none;
}

.hash-label {
  font-weight: 600;
  min-width: 80px;
  color: var(--text-secondary);
}

.hash-value {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  word-break: break-all;
  flex: 1;
}

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

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }
