@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --primary-color: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-light: #6b7280;
  --border-color: #e2e8f0;
  --input-bg: var(--card-bg);
  --input-text: var(--text-main);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* --- Dark Mode Variables --- */
[data-theme="dark"] {
  --primary-color: #818cf8;
  --primary-glow: rgba(129, 140, 248, 0.3);
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f1f5f9;
  --text-light: #94a3b8;
  --border-color: #334155;
  --input-bg: #1e293b;
  --input-text: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.15);
}


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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

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

/* --- Navbar Styling --- */
.navbar {
  background-color: var(--card-bg);
  padding: 1rem 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.navbar-links a {
  color: var(--text-main);
  margin-left: 1.5rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* --- Theme Toggle Button --- */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    transition: transform 0.4s ease;
}

.theme-toggle:hover svg {
    transform: rotate(45deg);
}

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

/* --- Tool Cards --- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
  background-color: var(--card-bg);
  border: none;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  overflow: hidden; /* Ensures content respects border-radius */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card h2 {
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}


/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
  color: white;
  background-image: linear-gradient(to right, #4f46e5, #6366f1);
  box-shadow: 0 4px 15px -5px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -5px var(--primary-glow);
}

[data-theme="dark"] .btn-primary {
    background-image: linear-gradient(to right, #6366f1, #818cf8);
}


/* --- Forms: Inputs & Textareas --- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--input-text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
    appearance: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
    resize: vertical;
    min-height: 120px;
}
.code-input, .code-input:focus {
  font-family: monospace;
}