/* ==================== GENERALE ==================== */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* ==================== HEADER ==================== */
.container > div:first-child {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin: -2rem -2rem 1.5rem -2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.container > div:first-child form {
  margin: 0;
}

.container > div:first-child .btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.container > div:first-child .btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* ==================== TITOLI ==================== */
h2 {
  color: #2d3748;
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

/* ==================== BREADCRUMB ==================== */
.d-flex.justify-content-between {
  background: #f7fafc;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.d-flex.justify-content-between a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.d-flex.justify-content-between a:hover {
  color: #764ba2;
}

.d-flex.justify-content-between strong {
  color: #2d3748;
}

/* ==================== LISTA CARTELLE ==================== */
.list-group {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  margin-bottom: 2rem;
}

.list-group-item {
  border: none;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 1.5rem;
  transition: all 0.3s ease;
}

.list-group-item:hover {
  background: #f7fafc;
  transform: translateX(5px);
}

.list-group-item:first-child {
  background: #edf2f7;
  font-weight: 600;
}

.list-group-item:first-child:hover {
  background: #e2e8f0;
}

.list-group-item a {
  color: #2d3748;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.list-group-item a i {
  font-size: 1.25rem;
  color: #667eea;
}

.list-group-item:first-child a i {
  color: #718096;
}

/* ==================== TABELLA FILE ==================== */
.table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.table thead th {
  border: none;
  padding: 1rem 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: all 0.3s ease;
  border-bottom: 1px solid #e2e8f0;
}

.table tbody tr:hover {
  background: #f7fafc;
  transform: scale(1.01);
}

.table tbody td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
}

.table tbody td a {
  color: #2d3748;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.table tbody td a:hover {
  color: #667eea;
}

/* ==================== BOTTONI ==================== */
.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  border: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
}

.btn-success {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.btn-warning {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* ==================== AREA UPLOAD ==================== */
#dropArea {
  border: 3px dashed #cbd5e0;
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#dropArea::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#dropArea:hover::before {
  opacity: 1;
}

#dropArea:hover {
  border-color: #667eea;
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

#dropArea.dragging {
  border-color: #48bb78;
  background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(72, 187, 120, 0.3);
}

#dropArea svg {
  color: #667eea;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 6px rgba(102, 126, 234, 0.2));
}

#dropText {
  font-size: 1.1rem;
  color: #4a5568;
  margin: 0;
  font-weight: 500;
}

#fileName {
  margin-top: 1rem;
  font-weight: 700;
  color: #48bb78;
  font-size: 1rem;
  background: rgba(72, 187, 120, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

#dropArea.uploading {
  pointer-events: none;
  opacity: 0.6;
}

#dropArea.uploading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid #e2e8f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==================== ICONE ==================== */
i.ph {
  transition: transform 0.3s ease;
}

a:hover i.ph,
button:hover i.ph {
  transform: scale(1.2);
}

/* ==================== HR ==================== */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
  margin: 1.5rem 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
    margin-top: 1rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .table {
    font-size: 0.9rem;
  }
  
  #dropArea {
    padding: 2rem 1rem;
    min-height: 180px;
  }
}