/* Modern 3D UI with Shadows and Hover Effects */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  --warning-color: #f97316;
  
  /* Neutral Colors */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* 3D Effects */
  --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-large: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 8px 10px rgba(0, 0, 0, 0.06);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
  
  /* Hover Shadows */
  --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.12), 0 6px 12px rgba(0, 0, 0, 0.08);
  --shadow-focus: 0 0 0 4px rgba(99, 102, 241, 0.15);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* Main Container with 3D Effect */
.main-container {
  max-width: 1400px;
  margin: 2rem auto;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

/* Header Section with Gradient and Depth */
.header-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: 3rem 2.5rem;
  text-align: center;
  color: white;
  position: relative;
}

.header-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.header-section h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.header-section p {
  font-size: 1.25rem;
  font-weight: 400;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
}

/* Upload Section with Elevated Cards */
.upload-section {
  padding: 3rem 2.5rem;
  background: white;
}

.upload-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--gray-200);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--gray-300);
}

/* Form Controls with 3D Effects */
.form-control-modern {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  background: white;
  box-shadow: var(--shadow-small);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-control-modern:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-focus);
  transform: translateY(-1px);
}

.form-select-modern {
  background: white 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") no-repeat right 1rem center/1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem 2.5rem 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: var(--shadow-small);
  transition: all 0.2s ease;
  appearance: none;
}

.form-select-modern:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-focus);
}

/* Modern Buttons with 3D Effects */
.btn-modern {
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

.btn-modern: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.6s;
}

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

.btn-primary-modern {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

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

.btn-secondary-modern {
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  color: var(--gray-700);
}

.btn-secondary-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
}

.btn-success-modern {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
  color: white;
}

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

/* Results Section with Depth */
.results-section {
  background: var(--gray-50);
  padding: 3rem 2.5rem;
  border-top: 1px solid var(--gray-200);
}

/* Analysis Cards with 3D Effects */
.analysis-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-large);
  border: 1px solid var(--gray-200);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.analysis-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-color);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.analysis-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2xl);
}

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

/* Issue Cards with Severity-Based Colors */
.issue-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-medium);
  border-left: 4px solid var(--gray-300);
  transition: all 0.2s ease;
}

.issue-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-large);
}

.issue-card.critical {
  border-left-color: var(--danger-color);
  background: linear-gradient(135deg, #fef2f2 0%, white 100%);
}

.issue-card.high {
  border-left-color: var(--warning-color);
  background: linear-gradient(135deg, #fffbeb 0%, white 100%);
}

.issue-card.medium {
  border-left-color: var(--accent-color);
  background: linear-gradient(135deg, #fefce8 0%, white 100%);
}

.issue-card.low {
  border-left-color: var(--secondary-color);
  background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

/* Code Blocks with Modern Styling */
.code-block {
  background: var(--gray-900);
  color: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-x: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--gray-700);
  position: relative;
}

.code-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* Copy Button for Code Blocks */
.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gray-300);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.05);
}

/* Stats Cards with 3D Effects */
.stats-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-large);
  border: 1px solid var(--gray-200);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stats-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-2xl);
}

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

.stats-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.stats-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Badges with 3D Effects */
.badge-3d {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-small);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-success {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
  color: white;
}

.badge-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #ea580c 100%);
  color: white;
}

.badge-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
  color: white;
}

.badge-info {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

/* Loading States */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Notification Toast */
.toast-3d {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  z-index: 1001;
  max-width: 400px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-3d.show {
  transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-container {
    margin: 1rem;
    border-radius: var(--radius-md);
  }
  
  .header-section {
    padding: 2rem 1.5rem;
  }
  
  .header-section h1 {
    font-size: 2rem;
  }
  
  .upload-section,
  .results-section {
    padding: 2rem 1.5rem;
  }
  
  .stats-card {
    margin-bottom: 1rem;
  }
}

/* Focus Indicators for Accessibility */
.focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}
