/*
 * This is a manifest file that'll be compiled into application.css.
 */

/*
 *= require security_report_styles
 */

/* ---------- Z-INDEX ИЕРАРХИЯ (Индустриальный стандарт для Tailwind) ---------- */
.content { z-index: 1; }
.dropdown-menu { z-index: 1000; }
.sticky-nav { z-index: 1010; }
.overlay, .popup-overlay { z-index: 1030; }
.modal-backdrop { z-index: 1040; }
.modal { z-index: 1050; }
.popover { z-index: 1060; }
.tooltip { z-index: 1070; }
.toast-notification { z-index: 1080; }

/* ---------- КНОПКИ КОПИРОВАНИЯ ---------- */
.copy-btn { 
  position: relative; 
  overflow: hidden; 
  z-index: 1; 
}

.copy-btn:disabled { 
  opacity: 0.7; 
  cursor: not-allowed; 
}

.copy-btn:disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: copy-btn-shimmer 1.5s infinite;
}

@keyframes copy-btn-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.copy-success { 
  animation: copy-success-bounce 0.6s ease-out; 
}

@keyframes copy-success-bounce {
  0%, 20%, 53%, 80%, 100% { 
    transform: translate3d(0, 0, 0); 
  }
  40%, 43% { 
    transform: translate3d(0, -8px, 0); 
  }
  70% { 
    transform: translate3d(0, -4px, 0); 
  }
  90% { 
    transform: translate3d(0, -2px, 0); 
  }
}

/* ---------- НЕОНОВЫЕ УТИЛИТЫ (glow) с GPU acceleration ---------- */
.neon-card {
  position: relative;
  overflow: hidden;
}

.neon-card::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 24px;
  filter: blur(32px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  background:
    radial-gradient(120px 60px at 12% 12%, rgba(56, 189, 248, 0.35), transparent),
    radial-gradient(160px 80px at 88% 88%, rgba(59, 130, 246, 0.35), transparent);
  /* GPU acceleration */
  will-change: opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

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

/* Плитка-иконка с градиентом и внутренним свечением */
.icon-gradient {
  position: relative;
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  transform: translateZ(0);
}

.icon-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.10);
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---------- RESPONSIVE UTILITIES ---------- */

/* Overflow protection для длинных URL */
.truncate-url {
  word-break: break-all;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Ellipsis для таблиц */
.table-cell-ellipsis {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Custom scrollbar для таблиц */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* POC blocks с ограничением высоты */
.poc-container {
  max-height: 400px;
  overflow-y: auto;
  position: relative;
}

.poc-container::-webkit-scrollbar {
  width: 8px;
}

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

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

.poc-container::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Touch target минимум 44x44px */
@media (hover: none) {
  button,
  a,
  .clickable {
    min-height: 44px;
    min-width: 44px;
  }
  
  .neon-card:hover::before {
    opacity: 0;
  }
}

/* ---------- МОБИЛЬНЫЕ ИСПРАВЛЕНИЯ ---------- */
@media only screen and (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  .hero-section .absolute {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin-top: 0.5rem;
    display: block;
    transform: none;
  }
}

/* ---------- TAILWIND ВСТАВКИ ---------- */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* ---------- СТИЛИ ОТЧЕТА ---------- */
.security-report {
  --color-critical: #dc3545;
  --color-high: #fd7e14;
  --color-medium: #ffc107;
  --color-low: #28a745;
  --color-info: #17a2b8;
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: "SF Mono", Monaco, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --spacer-xs: 0.25rem;
  --spacer-sm: 0.5rem;
  --spacer-md: 1rem;
  --spacer-lg: 1.5rem;
  --spacer-xl: 2rem;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  
  font-family: var(--font-family-base);
  line-height: 1.5;
  color: #212529;
  max-width: 820px;
  margin: 0 auto;
  padding: var(--spacer-md);
}

.security-report .report-header {
  text-align: center;
  margin-bottom: var(--spacer-lg);
  border-bottom: 3px solid var(--color-critical);
  padding-bottom: var(--spacer-md);
  background: linear-gradient(135deg, #fff, #f8f9fa);
}

.security-report .severity-badge {
  display: inline-block;
  padding: var(--spacer-xs) var(--spacer-sm);
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.security-report .vulnerability-card {
  border: 2px solid;
  border-radius: 0.5rem;
  margin-bottom: var(--spacer-md);
  padding: var(--spacer-md);
  box-shadow: var(--shadow-sm);
  page-break-inside: avoid;
}

.security-report .vulnerability-critical {
  border-color: var(--color-critical);
  background: rgba(220, 53, 69, 0.05);
}

.security-report .vulnerability-high {
  border-color: var(--color-high);
  background: rgba(253, 126, 20, 0.05);
}

.security-report .vulnerability-medium {
  border-color: var(--color-medium);
  background: rgba(255, 193, 7, 0.05);
}

.security-report .severity-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacer-md);
}

.security-report .severity-table th {
  background: linear-gradient(135deg, #343a40, #495057);
  color: #fff;
  padding: var(--spacer-sm);
  font-size: 0.75rem;
}

@media print {
  @page {
    margin: 10mm;
    size: A4;
  }
  
  .security-report {
    max-width: none;
    padding: 0;
  }
  
  .security-report .vulnerability-card {
    box-shadow: none;
    border-width: 1px;
  }
}
