@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0d0c0a;
  --bg-secondary: rgba(20, 18, 15, 0.8);
  --bg-tertiary: rgba(35, 30, 25, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  
  --color-primary: #f9711d; /* Signature Orange */
  --color-primary-glow: rgba(249, 113, 29, 0.2);
  --color-secondary: #fb923c; /* Light Orange */
  --color-success: #34d399; /* Green */
  --color-success-glow: rgba(52, 211, 153, 0.2);
  --color-warning: #fbbf24; /* Amber */
  --color-danger: #f87171; /* Rose */
  --color-danger-glow: rgba(248, 113, 113, 0.2);
  
  --text-main: #f3f4f6;
  --text-muted: #a1a1aa;
  --text-dark: #71717a;
  
  --sidebar-width: 280px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(129, 140, 248, 0.05) 0%, transparent 40%);
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.logo-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item:hover, .nav-item.active {
  color: #fff;
  background: var(--bg-tertiary);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.nav-item.active {
  color: var(--color-primary);
  border-color: rgba(249, 113, 29, 0.2);
  background: rgba(249, 113, 29, 0.05);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.gcp-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.gcp-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse 2s infinite;
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2.5rem;
  max-width: 1400px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
}

.system-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
}

/* Grid Dashboard */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  opacity: 0.5;
}

.kpi-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 6px;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-sub.positive {
  color: var(--color-success);
}

/* Main Panels */
.dashboard-panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.dashboard-panel.active {
  display: block;
}

.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .panel-row {
    grid-template-columns: 1fr;
  }
}

.card-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.75rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.card-panel h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Table Design */
.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.preistruttoria {
  background: rgba(129, 140, 248, 0.15);
  color: var(--color-secondary);
}
.status-badge.preistruttoria::before { background-color: var(--color-secondary); }

.status-badge.redazione {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-primary);
}
.status-badge.redazione::before { background-color: var(--color-primary); }

.status-badge.completato {
  background: rgba(52, 211, 153, 0.15);
  color: var(--color-success);
}
.status-badge.completato::before { background-color: var(--color-success); }

/* Interactive Timeline Tracker */
.timeline-tracker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.timeline-step::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 24px;
  width: 2px;
  height: calc(100% - 12px);
  background: var(--glass-border);
  z-index: 1;
}

.timeline-step:last-child::after {
  display: none;
}

.timeline-step.completed::after {
  background: var(--color-success);
}

.timeline-node {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: var(--transition-fast);
}

.timeline-step.completed .timeline-node {
  border-color: var(--color-success);
  background: var(--color-success);
  box-shadow: 0 0 10px var(--color-success-glow);
}

.timeline-step.active .timeline-node {
  border-color: var(--color-primary);
  background: var(--bg-primary);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

.timeline-node::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.timeline-step.active .timeline-node::after {
  background: var(--color-primary);
}

.timeline-content {
  flex: 1;
  padding-bottom: 20px;
}

.timeline-step.active .timeline-content h4 {
  color: var(--color-primary);
}

.timeline-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* File Upload & sniff analyzer */
.file-drop-zone {
  border: 2px dashed var(--glass-border);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  transition: var(--transition-fast);
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.file-drop-zone:hover {
  border-color: var(--color-primary);
  background: rgba(56, 189, 248, 0.02);
}

.file-drop-zone-icon {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.file-security-feedback {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem;
}

.security-report-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
}

.security-report-item:last-child {
  border: none;
}

.security-report-item span:first-child {
  color: var(--text-muted);
}

.security-report-item span.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom button */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}

/* GDPR Incident Panel timer countdown styling */
.countdown-box {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.countdown-segment {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  min-width: 60px;
}

.countdown-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-danger);
}

.countdown-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px var(--color-success); }
  100% { transform: scale(1); opacity: 0.6; }
}
