/* CyberShield Enterprise - CSS Bug Fixes & Theme Consistency */

/* ===== GLOBAL FIXES ===== */

/* Ensure consistent scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 5px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* ===== HEADER FIXES ===== */

/* Fix header alignment and spacing */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Logo styling fix */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.logo:hover {
  color: var(--accent-blue);
  transform: translateY(-2px);
}

.logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-blue), var(--secondary-blue));
  border-radius: 10px;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Navigation menu fixes */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  flex: 1;
  justify-content: center;
}

.nav-item {
  margin: 0;
}

.nav-item a {
  display: block;
  padding: 0.625rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-item a:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.nav-item a.active {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.15);
}

/* ===== DASHBOARD CARD FIXES ===== */

.dashboard-card {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.dashboard-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

/* Card header consistency */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-icon {
  color: var(--accent-blue);
  font-size: 1.25rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== BUTTON FIXES ===== */

.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--secondary-blue));
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== FORM INPUT FIXES ===== */

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-group {
  margin-bottom: 1.5rem;
}

/* ===== STATS GRID FIXES ===== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.stat-item:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.stat-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.stat-change.positive {
  color: var(--success-green);
}

.stat-change.negative {
  color: var(--danger-red);
}

/* ===== COLUMN LAYOUT FIXES ===== */

.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===== LOADING & PROGRESS FIXES ===== */

.loading-indicator {
  text-align: center;
  padding: 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--success-green));
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* ===== TABLE FIXES ===== */

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

td {
  padding: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
}

tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* ===== BADGE & TAG FIXES ===== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.critical {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.badge.high {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.low {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ===== RESPONSIVE FIXES ===== */

@media (max-width: 1200px) {
  .main-container {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    flex-wrap: wrap;
  }
  
  .nav-menu {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
  }
  
  .status-indicators {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  
  .status-indicator,
  .system-online-status,
  .last-updated-status {
    width: 100%;
    justify-content: flex-start;
  }
  
  .main-container {
    padding: 1rem;
    gap: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .logo span {
    display: none;
  }
}

/* ===== ANIMATION FIXES ===== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ===== ACCESSIBILITY FIXES ===== */

*:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Ensure sufficient contrast */
.text-muted {
  color: var(--text-secondary);
}

.text-primary {
  color: var(--text-primary);
}

.text-accent {
  color: var(--accent-blue);
}

/* ===== UTILITY CLASSES ===== */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ===== PRINT STYLES ===== */

@media print {
  .header,
  .nav-menu,
  .status-indicators,
  .particle-background {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .dashboard-card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}


/* ============================================
   IMAGE MALWARE SCANNER STYLES
============================================ */

.image-scanner-card {
  margin-bottom: 2rem;
}

.scanner-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 0.875rem;
  color: #10b981;
}

.scanner-content {
  padding: 1.5rem;
}

/* Upload Area */
.upload-section {
  margin-bottom: 1.5rem;
}

.upload-area {
  position: relative;
  border: 2px dashed rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  transition: all 0.3s ease;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-area.drag-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.02);
}

.upload-placeholder {
  text-align: center;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-placeholder:hover {
  transform: translateY(-5px);
}

.upload-icon {
  font-size: 4rem;
  color: #3b82f6;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.upload-placeholder h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

.upload-placeholder p {
  color: #94a3b8;
  margin-bottom: 1.5rem;
}

.supported-formats {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.format-badge {
  padding: 0.25rem 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  color: #3b82f6;
  font-weight: 500;
}

.upload-limit {
  display: block;
  color: #64748b;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Image Preview */
.image-preview-container {
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.preview-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #e2e8f0;
}

.preview-info i {
  color: #3b82f6;
  font-size: 1.25rem;
}

.preview-size {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.btn-remove {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

.preview-image {
  margin-bottom: 1.5rem;
  text-align: center;
  max-height: 300px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.preview-image img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
}

.btn-scan {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Scan Progress */
.scan-progress-container {
  padding: 2rem;
  text-align: center;
}

.scan-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.scan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 4px;
  animation: progress 2s ease-in-out infinite;
  width: 100%;
}

@keyframes progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.scan-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #3b82f6;
  font-size: 1.125rem;
}

.scan-status i {
  font-size: 1.5rem;
}

/* Scan Results */
.scan-results-container {
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.result-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.result-status.safe {
  color: #10b981;
}

.result-status.safe i {
  color: #10b981;
  font-size: 2rem;
}

.result-status.danger {
  color: #ef4444;
}

.result-status.danger i {
  color: #ef4444;
  font-size: 2rem;
}

.result-confidence {
  color: #94a3b8;
  font-size: 0.875rem;
}

.result-confidence span {
  color: #3b82f6;
  font-weight: 600;
}

/* Result Details */
.result-details {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.detail-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

.detail-label i {
  color: #3b82f6;
}

.detail-value {
  color: #e2e8f0;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

/* Threats List */
.threats-list {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
}

.threats-list h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ef4444;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.threat-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.threat-item:last-child {
  margin-bottom: 0;
}

.threat-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
  color: #ef4444;
  font-size: 1.25rem;
}

.threat-info {
  flex: 1;
}

.threat-type {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.25rem;
}

.threat-message {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.threat-severity {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.threat-severity.critical {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.threat-severity.high {
  background: rgba(251, 146, 60, 0.2);
  color: #fb923c;
}

.threat-severity.medium {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.threat-severity.low {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

/* Scan Actions */
.scan-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.scan-actions .btn {
  min-width: 200px;
}

/* Responsive */
@media (max-width: 768px) {
  .upload-placeholder h3 {
    font-size: 1.25rem;
  }
  
  .upload-icon {
    font-size: 3rem;
  }
  
  .result-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .detail-item {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .scan-actions {
    flex-direction: column;
  }
  
  .scan-actions .btn {
    width: 100%;
  }
}
