:root {
  /* Catppuccin Mocha */
  --primary: #89b4fa;
  --primary-dark: #74c7ec;
  --accent: #cba6f7;
  --bg: #1e1e2e;
  --bg-card: #181825;
  --bg-darker: #11111b;
  --text: #cdd6f4;
  --text-dim: #6c7086;
  --border: #313244;
  --success: #a6e3a1;
  --error: #f38ba8;
  --warning: #f9e2af;
  --peach: #fab387;
  --radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Monaco, 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
header {
  text-align: center;
  padding: 3rem 0 2rem;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header p {
  color: var(--text-dim);
  font-size: 1.1rem;
}

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

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(137, 180, 250, 0.15);
  border-color: var(--primary);
  background: var(--bg-darker);
}

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

.tool-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

/* Tool Page Layout */
.tool-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.tool-header {
  text-align: center;
  margin-bottom: 2rem;
}

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

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

.back-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

textarea,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9rem;
  resize: vertical;
  transition: all 0.2s ease;
}

textarea {
  min-height: 200px;
}

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

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(137, 180, 250, 0.3);
  transform: translateY(-1px);
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

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

/* Output */
.output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  min-height: 100px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

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

.output.error {
  border-color: var(--error);
  color: var(--error);
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 0 2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Dev Aesthetic */
code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: var(--bg-darker);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--peach);
}

/* Selection */
::selection {
  background: var(--primary);
  color: var(--bg);
}

/* Scrollbar (Webkit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
