/* Problem2Patent - Modern CSS Styles */
/* Enhanced design system with modern aesthetics and animations */

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

/* CSS Variables for Design System */
:root {
  /* Colors */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-900: #1e3a8a;
  
  --secondary-50: #f8fafc;
  --secondary-100: #f1f5f9;
  --secondary-200: #e2e8f0;
  --secondary-300: #cbd5e1;
  --secondary-400: #94a3b8;
  --secondary-500: #64748b;
  --secondary-600: #475569;
  --secondary-900: #0f172a;
  
  --accent-500: #8b5cf6;
  --accent-600: #7c3aed;
  
  --success-500: #10b981;
  --warning-500: #f59e0b;
  --error-500: #ef4444;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  --gradient-secondary: linear-gradient(135deg, var(--primary-50), var(--accent-50));
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--secondary-900);
  scroll-behavior: smooth;
}

.font-inter {
  font-family: var(--font-family);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--secondary-100);
  border-radius: var(--radius-lg);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--primary-500);
  border-radius: var(--radius-lg);
}

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

/* Grid Pattern Background */
.bg-grid-pattern {
  background-image: radial-gradient(circle, var(--primary-500) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.1;
}

/* Floating Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

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

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Animation Classes */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-blob {
  animation: blob 7s infinite;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

.animate-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Animation Delays */
.animation-delay-300 {
  animation-delay: 300ms;
}

.animation-delay-500 {
  animation-delay: 500ms;
}

.animation-delay-700 {
  animation-delay: 700ms;
}

.animation-delay-1000 {
  animation-delay: 1000ms;
}

.animation-delay-2000 {
  animation-delay: 2000ms;
}

.animation-delay-4000 {
  animation-delay: 4000ms;
}

/* Floating Elements */
.floating-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: blob 7s infinite;
  pointer-events: none;
}

/* Navigation Enhancements */
.nav-link {
  position: relative;
  transition: all var(--transition-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 50%;
  background: var(--gradient-primary);
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

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

/* Button Enhancements */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-xl);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
  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;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-secondary {
  background: white;
  color: var(--secondary-600);
  border: 2px solid var(--secondary-200);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-xl);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-base);
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--primary-500);
  color: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Card Enhancements */
.card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid var(--secondary-100);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-200);
}

.card-gradient {
  position: relative;
  overflow: hidden;
}

.card-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

/* Category Card Specific Styles */
.category-card {
  transition: all var(--transition-base);
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-8px) scale(1.02);
}

/* Problem Card Specific Styles */
.problem-card {
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.problem-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
  transition: left 0.6s;
}

.problem-card:hover::before {
  left: 100%;
}

/* Text Clamp Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Backdrop Blur Support */
.backdrop-blur-sm {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur-md {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Glass Effect */
.glass {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--secondary-200);
  border-top: 4px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Focus Styles */
.focus-ring:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Input Enhancements */
.input-enhanced {
  transition: all var(--transition-base);
  background-color: #f0f8ff; /* Light blue background */
  border: 2px solid var(--secondary-200);
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-base);
  color: var(--secondary-900);
  line-height: 1.5;
}

.input-enhanced:focus {
  background-color: #e6f3ff; /* Slightly darker light blue on focus */
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.input-enhanced:hover {
  background-color: #e8f2ff; /* Light blue on hover */
  border-color: var(--secondary-300);
}

/* Ensure placeholder text is visible */
.input-enhanced::placeholder {
  color: var(--secondary-500);
  opacity: 0.7;
}

/* Specific styling for textarea elements */
textarea.input-enhanced {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

/* Dark mode support for inputs */
@media (prefers-color-scheme: dark) {
  .input-enhanced {
    background-color: #1e293b; /* Dark blue-gray */
    border-color: #475569;
    color: #f1f5f9;
  }
  
  .input-enhanced:focus {
    background-color: #334155;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  }
  
  .input-enhanced:hover {
    background-color: #2d3748;
    border-color: #64748b;
  }
  
  .input-enhanced::placeholder {
    color: #94a3b8;
    opacity: 0.8;
  }
}

/* Ensure consistent styling for select elements */
select.input-enhanced {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
}

/* Modal Enhancements */
.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  animation: scaleIn 0.3s ease-out;
}

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

/* Tooltip */
.tooltip {
  position: relative;
  cursor: pointer;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--secondary-900);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 1000;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--secondary-900);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--secondary-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  transition: width var(--transition-slow);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  background: var(--primary-100);
  color: var(--primary-800);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
  .card {
    padding: var(--space-lg);
  }
  
  .category-card:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

/* Dark Theme Support */
.dark-theme {
  --secondary-50: #0f172a;
  --secondary-100: #1e293b;
  --secondary-500: #94a3b8;
  --secondary-600: #cbd5e1;
  --secondary-900: #f8fafc;
}

.dark-theme body {
  background: var(--secondary-50);
  color: var(--secondary-900);
}

.dark-theme .card {
  background: var(--secondary-100);
  border-color: var(--secondary-600);
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--secondary-900);
  }
  
  .btn-primary {
    border: 2px solid var(--secondary-900);
  }
}

/* Legacy Browser Support */
.no-backdrop-filter .backdrop-blur-sm {
  background: rgba(255, 255, 255, 0.9);
}

.no-backdrop-filter .backdrop-blur-md {
  background: rgba(255, 255, 255, 0.95);
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Container Queries Support */
@container (min-width: 400px) {
  .container-responsive {
    padding: var(--space-xl);
  }
}

/* Custom Properties for JavaScript Integration */
.js-enhanced {
  --interaction-state: normal;
}

.js-enhanced[data-state="loading"] {
  --interaction-state: loading;
  pointer-events: none;
  opacity: 0.7;
}

.js-enhanced[data-state="success"] {
  --interaction-state: success;
}

.js-enhanced[data-state="error"] {
  --interaction-state: error;
}
