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

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  /* High-end neutral color palette */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --accent: #a78bfa;
  
  /* Light mode colors */
  --bg-light: #fafbfc;
  --bg-gradient-light: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  --surface-light: rgba(255, 255, 255, 0.85);
  --surface-hover-light: rgba(255, 255, 255, 0.95);
  --text-light: #1a1a2e;
  --text-secondary-light: #6b7280;
  --border-light: rgba(0, 0, 0, 0.08);
  --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-hover-light: 0 8px 30px rgba(0, 0, 0, 0.08);
  
  /* Dark mode colors */
  --bg-dark: #0a0a0f;
  --bg-gradient-dark: linear-gradient(135deg, #0f1014 0%, #1a1a2e 100%);
  --surface-dark: rgba(26, 26, 46, 0.8);
  --surface-hover-dark: rgba(26, 26, 46, 0.9);
  --text-dark: #f8fafc;
  --text-secondary-dark: #94a3b8;
  --border-dark: rgba(255, 255, 255, 0.08);
  --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover-dark: 0 8px 30px rgba(0, 0, 0, 0.4);
  
  /* Glassmorphism variables */
  --glass-blur: 20px;
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-mode {
  background: var(--bg-gradient-light);
  color: var(--text-light);
}

body.dark-mode {
  background: var(--bg-gradient-dark);
  color: var(--text-dark);
}

/* Glassmorphism Base Styles */
.glass {
  background: var(--surface-light);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.dark-mode .glass {
  background: var(--surface-dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Enhanced Gradient Background */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-bg-soft {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
}

/* Enhanced Tool Card with Glassmorphism */
.tool-card {
  background: var(--surface-light);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-light);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tool-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover-light);
  background: var(--surface-hover-light);
}

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

.dark-mode .tool-card {
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-dark);
}

.dark-mode .tool-card:hover {
  box-shadow: var(--shadow-hover-dark);
  background: var(--surface-hover-dark);
}

/* Enhanced Input Focus */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  border-color: var(--primary-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode input:focus,
.dark-mode textarea:focus,
.dark-mode select:focus {
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
  border-color: var(--primary-light);
}

/* Enhanced Button Styles */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  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;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Enhanced Copy Button */
.copy-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.copy-btn:hover {
  transform: scale(1.08);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.copy-btn:active {
  transform: scale(0.95);
}

/* Enhanced Toast Notification */
.toast {
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1), fadeOut 0.4s ease 2.5s forwards;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Enhanced Loading Animation */
.loading {
  animation: pulse 2s ease-in-out infinite;
}

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

/* Enhanced Page Transition */
.page-transition {
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--accent) 100%);
  background-clip: content-box;
}

.dark-mode ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

/* Enhanced Responsive Header */
@media (max-width: 768px) {
  .mobile-menu {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
  }
  
  .dark-mode .mobile-menu {
    background: rgba(26, 26, 46, 0.95);
  }
  
  .mobile-menu.active {
    max-height: 600px;
  }
}

/* Enhanced Tool Page Styles */
.tool-container {
  min-height: calc(100vh - 200px);
}

.tool-page-card {
  background: var(--surface-light);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-light);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .tool-page-card {
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-dark);
}

/* Enhanced Code Editor Style */
.code-output {
  font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.7;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 16px;
}

.dark-mode .code-output {
  background: rgba(255, 255, 255, 0.02);
}

/* Enhanced Color Picker Custom Styles */
.color-preview {
  width: 100%;
  height: 220px;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-light);
}

.dark-mode .color-preview {
  box-shadow: var(--shadow-dark);
}

/* Enhanced Image Tool Styles */
.image-preview {
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
}

.image-preview:hover {
  box-shadow: var(--shadow-hover-light);
}

.dark-mode .image-preview {
  box-shadow: var(--shadow-dark);
}

.dark-mode .image-preview:hover {
  box-shadow: var(--shadow-hover-dark);
}

/* Enhanced Text Diff Styles */
.diff-add {
  background-color: rgba(34, 197, 94, 0.15);
  text-decoration: underline;
  text-decoration-color: rgba(34, 197, 94, 0.5);
  padding: 2px 4px;
  border-radius: 4px;
}

.diff-remove {
  background-color: rgba(239, 68, 68, 0.15);
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, 0.5);
  padding: 2px 4px;
  border-radius: 4px;
}

/* Enhanced Hero Search */
.hero-search {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.dark-mode .hero-search {
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid rgba(129, 140, 248, 0.2);
}

.hero-search:focus-within {
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  transform: scale(1.02);
}

/* Enhanced Tool Card New Design */
.tool-card-new {
  background: var(--surface-light);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-light);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tool-card-new::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 128px;
  height: 128px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tool-card-new:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

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

.dark-mode .tool-card-new {
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
}

.dark-mode .tool-card-new:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Enhanced Header Glass Effect */
header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

/* Enhanced Footer */
footer {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Enhanced Section Spacing */
section {
  padding: 5rem 1rem;
}

@media (max-width: 768px) {
  section {
    padding: 3rem 1rem;
  }
}

/* Enhanced Text Gradients */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Icon Containers */
.icon-container {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.3s ease;
}

.icon-container:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}

/* Enhanced Stats Cards */
.stat-card {
  background: var(--surface-light);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .stat-card {
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover-light);
}

.dark-mode .stat-card:hover {
  box-shadow: var(--shadow-hover-dark);
}

/* Enhanced Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.dark-mode input[type="range"]::-webkit-slider-thumb {
  background: var(--text-dark);
}

/* Enhanced Checkbox */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  background: var(--surface-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
  content: '✓';
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.dark-mode input[type="checkbox"] {
  border-color: var(--border-dark);
  background: var(--surface-dark);
}

/* Enhanced File Input */
input[type="file"] {
  display: none;
}

.file-upload-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 16px 32px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.file-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.file-upload-btn:active {
  transform: translateY(0);
}

/* Enhanced Navigation Links */
.nav-link {
  position: relative;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--primary);
}

/* Enhanced Section Titles */
.section-title {
  position: relative;
  display: inline-block;
}

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

/* Enhanced Spacing Utilities */
.spacing-sm { padding: 1rem; }
.spacing-md { padding: 1.5rem; }
.spacing-lg { padding: 2rem; }
.spacing-xl { padding: 3rem; }

.margin-sm { margin: 1rem; }
.margin-md { margin: 1.5rem; }
.margin-lg { margin: 2rem; }
.margin-xl { margin: 3rem; }

/* Enhanced Border Radius */
.rounded-sm { border-radius: 8px; }
.rounded-md { border-radius: 12px; }
.rounded-lg { border-radius: 16px; }
.rounded-xl { border-radius: 20px; }

/* Enhanced Typography */
.text-display {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.text-heading {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.text-subheading {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.text-body {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

.text-caption {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary-light);
}

.dark-mode .text-caption {
  color: var(--text-secondary-dark);
}
