/* Admin Styles */
:root {
  /* Cores Principais Admin */
  --admin-primary: #E91E63;
  --admin-primary-dark: #C2185B;
  --admin-secondary: #9C27B0;
  --admin-secondary-dark: #6A1B9A;
  
  /* Rose Gold */
  --admin-rose-gold: #F8B8C9;
  
  /* Status */
  --admin-success: #10b981;
  --admin-danger: #ef4444;
  --admin-warning: #f59e0b;
  
  /* Backgrounds - Modo Escuro */
  --admin-bg: #0D0A10;
  --admin-bg-light: #1A151F;
  --admin-bg-card: #221C2B;
  --admin-border: #3A3145;
  
  /* Textos */
  --admin-text: #FFFFFF;
  --admin-text-muted: #D1C8DB;
  --admin-text-secondary: #A89BB5;
  
  /* Gradientes */
  --admin-gradient: linear-gradient(135deg, #E91E63, #9C27B0);
  --admin-gradient-hover: linear-gradient(135deg, #C2185B, #6A1B9A);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Login Screen */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--admin-gradient);
}

.login-container {
  background: var(--admin-bg-card);
  padding: 3rem;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--admin-border);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--admin-text);
}

.btn-voltar {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: var(--admin-text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.btn-voltar:hover {
  color: var(--admin-text);
}

/* Admin Header */
.admin-header {
  background: var(--admin-bg-card);
  padding: 1.5rem 0;
  border-bottom: 2px solid var(--admin-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
}

.admin-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 1.5rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-logout {
  background: var(--admin-danger);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-logout:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* Admin Navigation */
.admin-nav {
  background: var(--admin-bg-light);
  padding: 1rem 0;
  border-bottom: 1px solid var(--admin-border);
  overflow-x: auto;
}

.admin-nav .container {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  color: var(--admin-text-muted);
  border: 1px solid var(--admin-border);
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  white-space: nowrap;
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--admin-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(233, 30, 99, 0.4);
  transform: translateY(-2px);
}

/* Admin Main */
.admin-main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

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

.section-header h2 {
  font-size: 1.8rem;
}

/* Buttons */
.btn-primary {
  background: var(--admin-gradient);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover {
  background: var(--admin-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(233, 30, 99, 0.5);
}

.btn-secondary {
  background: var(--admin-border);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-secondary:hover {
  opacity: 0.9;
}

.btn-action {
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
}

.btn-edit {
  background: var(--admin-primary);
  color: white;
}

.btn-delete {
  background: var(--admin-danger);
  color: white;
}

.btn-stock {
  background: var(--admin-rose-gold);
  color: #1A151F;
}

.btn-action:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Table */
.table-container {
  background: var(--admin-bg-card);
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: var(--admin-bg);
  background: var(--admin-gradient);
}

.admin-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: white;
  border-bottom: 2px solid var(--admin-border);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table tbody tr:hover {
  background: rgba(233, 30, 99, 0.05);
}

.product-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.status-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-disponivel {
  background: rgba(16, 185, 129, 0.2);
  color: var(--admin-success);
}

.status-indisponivel {
  background: rgba(239, 68, 68, 0.2);
  color: var(--admin-danger);
}

.status-ativo {
  background: rgba(16, 185, 129, 0.2);
  color: var(--admin-success);
}

.status-inativo {
  background: rgba(239, 68, 68, 0.2);
  color: var(--admin-danger);
}

.stock-low {
  color: var(--admin-danger);
  font-weight: bold;
}

.stock-ok {
  color: var(--admin-success);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--admin-text);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.15);
}

.form-group small {
  display: block;
  margin-top: 0.3rem;
  color: var(--admin-text-muted);
  font-size: 0.85rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.config-form {
  background: var(--admin-bg-card);
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 10, 16, 0.9);
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--admin-bg-card);
  padding: 2rem;
  border-radius: 15px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--admin-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
}

.close {
  position: absolute;
  right: 1.5rem;
  top: 1rem;
  font-size: 2rem;
  font-weight: bold;
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: var(--admin-danger);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.modal-actions button {
  flex: 1;
}

/* Error Message */
.error-message {
  color: var(--admin-danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 0.8rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: none;
}

.error-message.show {
  display: block;
}

.success-message {
  color: var(--admin-success);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--admin-text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-table {
    font-size: 0.85rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.7rem 0.5rem;
  }

  .modal-actions {
    flex-direction: column;
  }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--admin-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--admin-gradient);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--admin-gradient-hover);
}

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

.admin-section.active {
  animation: fadeIn 0.3s ease-out;
}

/* Efeito de brilho nos badges */
.status-badge {
  position: relative;
  overflow: hidden;
}

.status-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.5s;
}

.status-badge:hover::before {
  left: 100%;
}
