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

:root {
  /* Colors */
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --bg-light: #f8fafc;
  --bg-lighter: #ffffff;
  
  --text-dark: #e2e8f0;
  --text-light: #334155;
  --text-muted-dark: #94a3b8;
  --text-muted-light: #64748b;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #ec4899;
  
  --border-light: #e2e8f0;
  --border-dark: #1e293b;
  
  --danger: #ef4444;
  --success: #10b981;
  
  /* Core variables */
  --bg-color: var(--bg-light);
  --bg-alt: var(--bg-lighter);
  --text-color: var(--text-light);
  --text-muted: var(--text-muted-light);
  --border-color: var(--border-light);
  --card-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: rgba(0, 0, 0, 0.05);

  --font-family: 'Outfit', sans-serif;
  --container-width: 1200px;
}

[data-theme="dark"] {
  --bg-color: var(--bg-dark);
  --bg-alt: var(--bg-darker);
  --text-color: var(--text-dark);
  --text-muted: var(--text-muted-dark);
  --border-color: var(--border-dark);
  --card-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Background gradient blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: float 20s infinite ease-in-out;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, rgba(99,102,241,0) 70%);
  animation-delay: 0s;
}

.blob-2 {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(236,72,153,0.15) 0%, rgba(236,72,153,0) 70%);
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

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

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

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

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

.theme-toggle:hover {
  background: var(--border-color);
  transform: rotate(15deg);
}

/* Hero Section */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

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

/* Tools Grid */
.tools-section {
  padding: 2rem 0 6rem;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Glassmorphism Cards */
.card {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background-color: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 30px var(--glass-shadow);
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 40px var(--glass-shadow);
  border-color: var(--primary);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card p {
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.card-action {
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.card-action svg {
  transition: transform 0.2s ease;
}

.card:hover .card-action svg {
  transform: translateX(4px);
}

/* Button & Forms */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-family);
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--secondary));
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

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

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

.input-group {
  margin-bottom: 1.5rem;
}

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-alt);
  color: var(--text-color);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Ads/* Shared Elements */
.ad-container {
    width: 100%;
    margin-top: 3rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
}
.ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: var(--bg-alt);
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cookie-banner.show {
    transform: translateY(0);
}
.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
}
.cookie-banner a {
    color: var(--primary);
    text-decoration: underline;
}
.cookie-banner button {
    margin-left: 1rem;
    white-space: nowrap;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
}

/* Tool Page Specific */
.tool-header {
  padding: 4rem 0 2rem;
  text-align: center;
}

.tool-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.tool-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.tool-workspace {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background-color: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 30px var(--glass-shadow);
  margin-bottom: 4rem;
}

.result-box {
  background-color: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  min-height: 50px;
  font-family: monospace;
  word-break: break-all;
  white-space: pre-wrap;
  position: relative;
}

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-center { text-align: center; }

@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .ad-placeholder { height: auto; min-height: 250px; max-width: 300px; } /* Mobile banner */
}
