/* ==========================================================================
   Global Styles - Modern SaaS-style with glassmorphism & subtle gradients
   Tailwind CDN handles utilities → this file only custom overrides
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  
  --success-500: #10b981;
  --warning-500: #f59e0b;
  --danger-500: #ef4444;
  
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  --bg-light: #f8fafc;
  --bg-dark:  #0f172a;
  
  --card-light: rgba(255, 255, 255, 0.75);
  --card-dark:  rgba(30, 41, 59, 0.75);
  
  --glass-bg:    rgba(255, 255, 255, 0.06);
  --glass-border:rgba(255, 255, 255, 0.12);
  
  --shadow-sm:   0 4px 12px -2px rgba(0,0,0,0.08);
  --shadow-md:   0 10px 30px -10px rgba(0,0,0,0.14);
  --shadow-hover:0 20px 40px -15px rgba(37,99,235,0.28);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-light);
  color: var(--gray-900);
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.dark {
  background-color: var(--bg-dark);
}

/* === DARK MODE TEXT READABILITY – FULL FIX === */
body, h1, h2, h3, h4, h5, h6, p, li, span, div, label,
.prose, .prose *, 
.text-gray-700, .text-gray-800, .text-gray-900,
.bg-gradient-to-r.bg-clip-text {
  color: var(--gray-900);
}

.dark body,
.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6,
 .dark li, .dark span, .dark div, .dark label,
.dark .prose, .dark .prose *,
.dark .bg-gradient-to-r.bg-clip-text {
  color: var(--gray-900) !important;
}

/* Secondary text in dark mode */
.dark .text-gray-600,
.dark .text-gray-500,
.dark .text-gray-400 {
  color: var(--gray-400) !important;
}

/* Links */
.dark a {
  color: #60a5fa;
}

.dark a:hover {
  color: #93c5fd;
}

/* Glassmorphism Cards */
.modern-card {
  background: var(--card-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow: hidden;
}

.dark .modern-card {
  background: var(--card-dark);
  border-color: var(--glass-border);
}

.modern-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

/* Modern Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 0.875rem;
  box-shadow: 0 4px 14px rgba(59,130,246,0.3);
  transition: all 0.32s ease;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59,130,246,0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

/* === FIXED HEADER – balanced layout, ad centered & compact, nav wraps safely === */
header {
  background: linear-gradient(135deg, #1e40af 0%, var(--primary-600) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 1rem 0;
}

header .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header .top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 {
  font-size: 2.25rem;
  margin: 0;
  white-space: nowrap;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  justify-content: flex-end;
}

header nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  transition: color 0.2s;
  white-space: nowrap;
}

header nav a:hover {
  color: #dbeafe;
}

/* Header Ad – centered, compact, elegant */
header .ad-container {
  width: 100%;
  max-width: 728px;
  margin: 1rem auto 0;
}

header .ad-placeholder {
  height: 90px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 0.75rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

/* Footer fix – readable text in both modes */
footer {
  background: var(--gray-800);
  color: white;
  padding: 2rem 1.5rem;
  text-align: center;
}

.dark footer {
  background: var(--gray-900);
  color: white;
}

footer a {
  color: var(--primary-400);
  text-decoration: none;
}

footer a:hover {
  color: var(--primary-300);
}

/* Category icon circles */
.category-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  transition: transform 0.3s ease;
}

.modern-card:hover .category-icon {
  transform: scale(1.08) rotate(3deg);
}

/* Tool container */
.tool-container {
  @apply modern-card p-8 md:p-10;
}

/* Ad placeholders - general */
.ad-placeholder {
  background: rgba(243,244,246,0.5);
  backdrop-filter: blur(4px);
  border: 1px dashed rgba(209,213,219,0.5);
  border-radius: 0.75rem;
  color: var(--gray-600);
  font-size: 0.875rem;
  text-align: center;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.dark .ad-placeholder {
  background: rgba(55,65,81,0.4);
  border-color: rgba(75,85,99,0.5);
  color: var(--gray-400);
}

/* Theme toggle */
#theme-toggle {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  transition: all 0.3s ease;
}

.dark #theme-toggle {
  background: rgba(30,41,59,0.4);
}

/* Responsive sidebar hide */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}