/* legalSphere Platform - Custom Styles */

/* Custom animations and transitions */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out;
}

.animate-slideIn {
  animation: slideIn 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Custom hover effects */
.hover-lift:hover {
  transform: translateY(-4px);
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

/* Custom gradients */
.gradient-legal {
  background: linear-gradient(135deg, #1e3a8a 0%, #059669 100%);
}

.gradient-risk-low {
  background: linear-gradient(90deg, #dcfce7 0%, #bbf7d0 100%);
}

.gradient-risk-medium {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
}

.gradient-risk-high {
  background: linear-gradient(90deg, #fee2e2 0%, #fecaca 100%);
}

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

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Loading spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1e3a8a;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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

/* Progress bars */
.progress-bar {
  background: linear-gradient(90deg, #e5e7eb 0%, #e5e7eb 100%);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease-in-out;
}

.progress-green { background: linear-gradient(90deg, #10b981 0%, #059669 100%); }
.progress-blue { background: linear-gradient(90deg, #3b82f6 0%, #1e40af 100%); }
.progress-orange { background: linear-gradient(90deg, #f59e0b 0%, #ea580c 100%); }
.progress-red { background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%); }

/* Card shadows and effects */
.card-shadow {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-glow {
  position: relative;
}

.card-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(45deg, #1e3a8a, #059669, #f59e0b, #dc2626);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-glow:hover::before {
  opacity: 0.7;
}

/* Status indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-compliant { background-color: #10b981; }
.status-partial { background-color: #f59e0b; }
.status-non-compliant { background-color: #ef4444; }
.status-pending { background-color: #6b7280; }

/* Risk level indicators */
.risk-indicator {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-low { background-color: #dcfce7; color: #166534; }
.risk-medium { background-color: #fef3c7; color: #92400e; }
.risk-high { background-color: #fee2e2; color: #991b1b; }
.risk-critical { background-color: #fecaca; color: #7f1d1d; }

/* Legal health score gauge */
.health-gauge {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.health-gauge-bg {
  stroke: #e5e7eb;
  fill: none;
  stroke-width: 8;
}

.health-gauge-progress {
  stroke: #10b981;
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease-in-out;
}

.health-score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: bold;
  color: #1f2937;
}

/* Interactive elements */
.interactive-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.interactive-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.interactive-card:active {
  transform: translateY(0);
}

/* Document upload area */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.3s ease;
  cursor: pointer;
}

.upload-zone:hover {
  border-color: #1e3a8a;
  background-color: #f8fafc;
}

.upload-zone.dragover {
  border-color: #059669;
  background-color: #ecfdf5;
}

/* Notification styles */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  max-width: 400px;
  padding: 1rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.notification.show {
  transform: translateX(0);
}

.notification-success { background-color: #10b981; }
.notification-error { background-color: #ef4444; }
.notification-warning { background-color: #f59e0b; }
.notification-info { background-color: #3b82f6; }

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .nav-item {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .health-gauge {
    width: 80px;
    height: 80px;
  }
  
  .health-score-text {
    font-size: 1.125rem;
  }
  
  .notification {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  /* Mobile touch improvements */
  button, a {
    min-height: 44px; /* iOS touch target size */
    min-width: 44px;
  }

  /* Mobile form improvements */
  input, select, textarea {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px;
  }

  /* Mobile navigation improvements */
  .mobile-menu-item {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 4px 0;
  }

  /* Mobile card improvements */
  .card-mobile {
    margin: 8px;
    padding: 16px;
    border-radius: 12px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 1.875rem; /* 30px */
    line-height: 2.25rem;
  }

  h2 {
    font-size: 1.5rem; /* 24px */
    line-height: 2rem;
  }

  /* Smaller padding on mobile */
  .mobile-padding {
    padding: 12px;
  }

  /* Stack buttons vertically on very small screens */
  .mobile-stack > * {
    width: 100%;
    margin-bottom: 8px;
  }
}

/* Responsive text sizing */
@media (max-width: 640px) {
  .responsive-text-sm {
    font-size: 0.875rem;
  }
  
  .responsive-text-base {
    font-size: 1rem;
  }
  
  .responsive-text-lg {
    font-size: 1.125rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .hover-scale:hover {
    transform: none;
  }
  
  .hover-lift:hover {
    transform: none;
  }
  
  /* Larger touch targets */
  button, .interactive-card {
    padding: 16px;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-break {
    page-break-after: always;
  }
  
  .card-shadow {
    box-shadow: none;
    border: 1px solid #d1d5db;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .gradient-legal {
    background: #000;
    color: #fff;
  }
  
  .status-dot {
    border: 2px solid currentColor;
  }
}

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

/* Custom utility classes */
.text-legal-blue { color: #1e3a8a; }
.text-legal-green { color: #059669; }
.text-legal-orange { color: #ea580c; }
.text-legal-red { color: #dc2626; }

.bg-legal-blue { background-color: #1e3a8a; }
.bg-legal-green { background-color: #059669; }
.bg-legal-orange { background-color: #ea580c; }
.bg-legal-red { background-color: #dc2626; }

.border-legal-blue { border-color: #1e3a8a; }
.border-legal-green { border-color: #059669; }
.border-legal-orange { border-color: #ea580c; }
.border-legal-red { border-color: #dc2626; }

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1f2937;
    color: #f9fafb;
  }
  
  .bg-white {
    background-color: #374151 !important;
    color: #f9fafb;
  }
  
  .border {
    border-color: #4b5563;
  }
  
  .text-gray-600 {
    color: #d1d5db !important;
  }
  
  .text-gray-700 {
    color: #e5e7eb !important;
  }
  
  .text-gray-900 {
    color: #f9fafb !important;
  }
}