/* Header Styles */
.header {
  background-color: #f5f3f0;
  border-bottom: 1px solid #ddd;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
}

.logo {
  height: 36px;
  width: auto;
}

.nav-section {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-link {
  color: #333;
  text-decoration: none;
  font-weight: 400;
  font-size: 16px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #0d3512;
}

.exit-btn {
  background-color: #0d2447;
  color: white !important;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.exit-btn:hover {
  background-color: #0a1d35 !important;
  color: white !important;
}

/* Main content adjustment */
.main-content {
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 0;
  margin: 0;
  background: #fffbf6;
  min-height: 100vh;
}

h1 {
  color: #0e2841;
  text-align: center;
  margin-bottom: 10px;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
  text-align: center;
  color: #104862;
  font-size: 1.2em;
  margin-bottom: 40px;
  font-style: italic;
}

.lists-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.list-section {
  background: #fffbf6;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 2px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.list-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(13, 36, 71, 0.1), transparent);
}

.list-section h3 {
  color: #0d2447;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 24px 0;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 16px;
}

.vertical-list {
  margin-bottom: 24px;
  min-height: 80px;
}

.vertical-list .item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fffbf6;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.vertical-list .item:hover {
  background: #fef7ec;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.vertical-list .item input,
.vertical-list .item select {
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  background: white;
  color: #374151;
  transition: border-color 0.2s ease;
}

.vertical-list .item input:focus,
.vertical-list .item select:focus {
  outline: none;
  border-color: #0d2447;
  box-shadow: 0 0 0 3px rgba(13, 36, 71, 0.1);
}

/* Comentado para unificar todos os botões de lixeira
.vertical-list .item .delete-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 18px;
}

.vertical-list .item .delete-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}
*/

.input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  padding: 5px;
  background: #fffbf6;
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* Override para mobile */
@media (max-width: 768px) {
  .input-container.activity-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
  }
}

.input-container:hover {
  background: #e9ecef;
  transform: translateX(2px);
}

input[type="text"] {
  width: 180px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #104862;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

button {
  margin-top: 5px;
  padding: 10px 16px;
  width: fit-content;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.delete-btn {
  background: none;
  color: #9ca3af;
  border: none;
  border-radius: 4px;
  padding: 8px;
  font-size: 18px;
  margin-top: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.delete-btn:hover {
  color: #ef4444;
  background: #fef2f2;
  transform: none;
  box-shadow: none;
}

.add-btn {
  background-color: #0d2447;
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: auto;
  box-shadow: 0 4px 16px rgba(13, 36, 71, 0.2);
}

.add-btn:hover {
  background-color: #0a1d35;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 36, 71, 0.3);
}

.add-btn:active {
  transform: translateY(0);
}

.action-buttons {
  padding: 30px 40px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.generate-btn {
  background-color: #0d2447;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 24px;
  transition: all 0.2s;
}

.generate-btn:hover {
  background-color: #0a1d35;
  transform: translateY(-1px);
}

.optimize-btn {
  background-color: #059669;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 24px;
  transition: all 0.2s;
}

.optimize-btn:hover {
  background-color: #047857;
  transform: translateY(-1px);
}

.export-btn, .import-btn {
  background-color: white;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 24px;
  transition: all 0.2s;
}

.export-btn:hover, .import-btn:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.help-section {
  background: white;
  border-radius: 16px;
  padding: 32px;
  margin: 40px auto;
  max-width: 1200px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
}

.help-section h3 {
  margin-top: 0;
  color: #0d2447;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
}

.help-section ol {
  line-height: 1.8;
  color: #374151;
}

.help-section li {
  margin-bottom: 12px;
}

.help-section ul {
  margin: 8px 0;
  color: #6b7280;
}

.help-section strong {
  color: #0d2447;
  font-weight: 600;
}

.help-section em {
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 6px;
  border-radius: 4px;
  font-style: normal;
  font-weight: 500;
  font-size: 0.9em;
}

.matrices-container {
  margin-top: 40px;
  background: #fef7ec;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.matriz-section {
  margin-bottom: 50px;
}

.matriz-section h3 {
  margin-bottom: 20px;
  font-size: 1.5em;
  color: #2c3e50;
  text-align: center;
  padding: 15px;
  background: linear-gradient(45deg, #fef7ec, #fef7ec);
  color: #0d3512;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(219, 228, 235, 0.3);
}

.matriz-container {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  margin-bottom: 30px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}

th, td {
  border: 1px solid whitesmoke;
  padding: 12px;
  text-align: center;
  min-width: 120px;
}

th {
  background: linear-gradient(45deg, #34495e, #2c3e50);
  color: white;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

td {
  background: #f8f9fa;
  transition: all 0.3s ease;
}

td:hover {
  background: #e9ecef;
}

td input {
  width: 100px;
  padding: 8px;
  border: 2px solid white;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  transition: all 0.3s ease;
}

td input:focus {
  outline: none;
  border-color: #fef7ec;
  box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
  background: white;
}

/* Responsividade */
@media (max-width: 1024px) {
  .lists-container {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  
  .activity-container {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px;
  }
  
  .activity-container .field-label:nth-child(1),
  .activity-container .activity-name {
    grid-column: 1 / -1;
  }
  
  .activity-container .field-label:nth-child(3),
  .activity-container .activity-workload,
  .activity-container .field-label:nth-child(5),
  .activity-container .activity-rest {
    grid-column: auto;
  }
  
  .activity-container .delete-btn {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 5px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  h1 {
    font-size: 2em;
  }
  
  .lists-container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 16px;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: stretch;
    padding: 24px 16px;
  }
  
  .action-buttons button {
    width: 100%;
  }
  
  .help-section {
    margin: 24px 16px;
    padding: 24px;
  }
  
  .help-section h3 {
    font-size: 20px;
  }
  
  .matriz-section h3 {
    font-size: 1.2em;
    padding: 10px;
  }
  
  th, td {
    padding: 8px;
    min-width: 80px;
    font-size: 13px;
  }
  
  td input {
    width: 70px;
    padding: 6px;
    font-size: 12px;
  }
  
  .activity-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
  }
  
  .activity-container .field-label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
  }
  
  .activity-container .activity-name,
  .activity-container .activity-workload,
  .activity-container .activity-rest {
    width: 100%;
    max-width: none;
    margin-bottom: 10px;
  }
  
  .activity-container .delete-btn {
    align-self: center;
    margin-top: 10px;
  }
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.matriz-section {
  animation: fadeIn 0.6s ease-out;
}

.list-section {
  animation: fadeIn 0.4s ease-out;
}

/* Estados de loading e sucesso */
.button-loading {
  position: relative;
  color: transparent !important;
}

.button-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.button-success {
  background: linear-gradient(45deg, #27ae60, #229954) !important;
}

.button-error {
  background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
}