/* Reset e Configurações Base */
* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
    135deg,
    #8b4513 0%,
    #d2691e 20%,
    #a0522d 50%,
    #654321 100%
  );
  min-height: 100vh;
  color: #333;
}

/* Navbar Customizada */
.navbar {
  z-index: 1050;
  height: 60px;
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
}

.navbar-brand i {
  color: #ffd700;
  margin-right: 10px;
}

/* Botão do menu toggle */
#sidebarToggle {
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

#sidebarToggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 60px; /* Altura da navbar */
  left: 0;
  width: 250px;
  height: calc(100vh - 60px);
  background: linear-gradient(180deg, #654321 0%, #8b4513 50%, #a0522d 100%);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  z-index: 1040;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h5 {
  color: #ecf0f1;
  margin: 0;
  font-weight: 600;
}

.sidebar-header i {
  color: #ffd700;
  margin-right: 10px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: #d2b48c;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.sidebar-menu li a:hover {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  transform: translateX(5px);
}

.sidebar-menu li.active a {
  background: linear-gradient(90deg, #b8860b, #daa520);
  color: white;
  box-shadow: 0 2px 10px rgba(218, 165, 32, 0.4);
}

.sidebar-menu li a i {
  margin-right: 15px;
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-menu li a span {
  font-weight: 500;
}

/* Main Content */
.main-content {
  margin-left: 250px; /* Largura do sidebar */
  padding-top: 60px; /* Altura da navbar */
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* Sidebar Overlay (para mobile) */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
  display: none;
}

/* Responsividade do Sidebar */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-overlay.show {
    display: block;
  }
}

/* Cards de Indicadores */
.card {
  border: none;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
  background: linear-gradient(45deg, #8b4513, #a0522d);
  color: white;
  border-radius: 15px 15px 0 0 !important;
  border: none;
  font-weight: 600;
}

/* Cards de Indicadores Coloridos - Tema Mineração */
.bg-primary {
  background: linear-gradient(
    45deg,
    #b8860b,
    #daa520
  ) !important; /* Dourado escuro */
}

.bg-success {
  background: linear-gradient(
    45deg,
    #228b22,
    #32cd32
  ) !important; /* Verde floresta */
}

.bg-warning {
  background: linear-gradient(
    45deg,
    #ff8c00,
    #ffa500
  ) !important; /* Laranja mineral */
}

.bg-info {
  background: linear-gradient(
    45deg,
    #708090,
    #2f4f4f
  ) !important; /* Cinza ardósia */
}

/* Galeria de Imagens */
.galeria-item {
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.galeria-item:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.galeria-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.galeria-item:hover img {
  filter: brightness(0.8);
}

.galeria-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 10px;
}

.galeria-item:hover::after {
  opacity: 1;
}

.galeria-overlay {
  position: absolute;
  bottom: 15px;
  left: 15px;
  color: white;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.galeria-item:hover .galeria-overlay {
  opacity: 1;
}

/* Upload Area */
.upload-area {
  border: 2px dashed #dee2e6 !important;
  background: rgba(248, 249, 250, 0.8);
  transition: all 0.3s ease;
}

.upload-area:hover {
  border-color: #daa520 !important;
  background: rgba(218, 165, 32, 0.1);
}

/* Botões Customizados */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 10px 20px;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(45deg, #b8860b, #daa520);
  border: none;
}

.btn-success {
  background: linear-gradient(45deg, #228b22, #32cd32);
  border: none;
}

.btn-outline-primary {
  border: 2px solid #b8860b;
  color: #b8860b;
  background: transparent;
}

.btn-outline-primary:hover {
  background: #b8860b;
  color: white;
}

/* Modal Customizado */
.modal-content {
  border: none;
  border-radius: 15px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
  background: linear-gradient(45deg, #8b4513, #a0522d);
  color: white;
  border-radius: 15px 15px 0 0;
  border: none;
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border: none;
  padding: 1rem 2rem 2rem;
}

/* Badges */
.badge {
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 20px;
}

/* Tabelas */
.table {
  margin-bottom: 0;
}

.table td {
  border: none;
  padding: 8px 0;
}

.table tr:not(:last-child) td {
  border-bottom: 1px solid #f1f3f4;
}

/* Gráficos */
canvas {
  border-radius: 10px;
}

/* Gráfico do Modal - altura fixa para evitar crescimento infinito */
#grafico-modal {
  max-height: 300px !important;
  height: 300px !important;
}

/* Animações */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.6s ease forwards;
}

.card:nth-child(1) {
  animation-delay: 0.1s;
}
.card:nth-child(2) {
  animation-delay: 0.2s;
}
.card:nth-child(3) {
  animation-delay: 0.3s;
}
.card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Status Badges */
.status-ativo {
  background: linear-gradient(45deg, #228b22, #32cd32);
  color: white;
}

.status-manutencao {
  background: linear-gradient(45deg, #ff8c00, #ffa500);
  color: white;
}

.status-inativo {
  background: linear-gradient(45deg, #696969, #2f4f4f);
  color: white;
}

/* Qualidade do Veio */
.qualidade-alta {
  color: #228b22;
  font-weight: bold;
}

.qualidade-media {
  color: #ff8c00;
  font-weight: bold;
}

.qualidade-baixa {
  color: #b22222;
  font-weight: bold;
}

/* Responsividade */
@media (max-width: 768px) {
  .container-fluid {
    padding: 0 15px;
  }

  .galeria-item img {
    height: 150px;
  }

  .card-body {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  /* Ajustes específicos para mobile com sidebar */
  .main-content {
    padding: 10px;
  }
}

@media (max-width: 576px) {
  .galeria-item {
    margin-bottom: 15px;
  }

  .galeria-item img {
    height: 120px;
  }

  .card {
    margin-bottom: 15px;
  }

  .navbar-brand {
    font-size: 1.2rem;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #8b4513, #a0522d);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #a0522d, #d2691e);
}
