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

/* Base styles for exploit-forge theme */
@layer base {
  /* Dark mode by default */
  :root {
    color-scheme: dark;
  }
  
  html {
    @apply antialiased;
  }
  
  body {
    @apply bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-gray-100;
  }
}

/* Custom scrollbar for dark theme */
@layer components {
  .scrollbar-custom {
    scrollbar-width: thin;
    scrollbar-color: theme('colors.gray.600') theme('colors.gray.800');
  }
  
  .scrollbar-custom::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  .scrollbar-custom::-webkit-scrollbar-track {
    @apply bg-gray-800 rounded;
  }
  
  .scrollbar-custom::-webkit-scrollbar-thumb {
    @apply bg-gray-600 rounded hover:bg-gray-500;
  }
}

/* Custom scrollbar for logs */
.logs-container::-webkit-scrollbar {
  width: 8px;
}

.logs-container::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Terminal-like styling for logs */
.terminal {
  background: #0d1117;
  color: #00ff00;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
}

/* JWT color coding */
.jwt-header {
  color: #ef4444;
}

.jwt-payload {
  color: #8b5cf6;
}

.jwt-signature {
  color: #3b82f6;
}

/* Smooth transitions for theme switching */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Disable transitions on theme change to prevent flash */
.transitioning * {
  transition: none !important;
}

/* Custom focus styles */
input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* Exploit-forge gradient backgrounds */
.gradient-ef-primary {
  background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

.gradient-ef-secondary {
  background: linear-gradient(135deg, #283593 0%, #3949ab 100%);
}

.gradient-ef-accent {
  background: linear-gradient(135deg, #00acc1 0%, #00bcd4 100%);
}

/* Button hover effects */
.btn-hover {
  transition: all 0.2s ease-in-out;
}

.btn-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Card hover effects */
.card-hover {
  transition: all 0.2s ease-in-out;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* JSON syntax highlighting */
.json-key {
  color: #8b5cf6;
}

.json-string {
  color: #10b981;
}

.json-number {
  color: #f59e0b;
}

.json-boolean {
  color: #ef4444;
}

/* Loading spinner */
.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

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

/* Status indicators */
.status-success {
  background-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
}

.status-error {
  background-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
}

.status-warning {
  background-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3);
}

/* Enhanced focus visibility */
.focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Fix for textarea resize in panels */
textarea {
  min-height: 8rem;
}

/* Monospace font for code sections */
.font-mono {
  font-feature-settings: "liga" 0;
}

/* Exploit-forge branded elements */
.ef-logo {
  background: linear-gradient(135deg, #1a237e 0%, #00bcd4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Mobile responsive improvements */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Stack grid columns on mobile */
  .grid {
    gap: 1rem;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}
