/* =====================================================================
   SISTEMA DE DESIGN & CRIAÇÃO DE VARIÁVEIS (MATERIAL SLATE PREMIUM)
   ===================================================================== */
:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111622;
  --bg-panel: rgba(25, 32, 49, 0.45);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  
  --color-primary: #3b82f6; /* Azul neon */
  --color-primary-glow: rgba(59, 130, 246, 0.45);
  --color-purple: #a855f7;  /* Roxo neon */
  --color-purple-glow: rgba(168, 85, 247, 0.45);
  --color-danger: #ef4444;
  --color-success: #10b981;

  --font-main: 'Inter', sans-serif;
  --font-title: 'Outfit', sans-serif;

  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

/* =====================================================================
   RESET GLOBAL & ESTILOS BÁSICOS DO CORPUS
   ===================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

input, button {
  font-family: inherit;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =====================================================================
   ELEMENTOS DE FUNDO DINÂMICOS (NEONS E PARTÍCULAS)
   ===================================================================== */
.bg-glow {
  position: fixed;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  filter: blur(10vw);
  z-index: -1;
  opacity: 0.18;
  pointer-events: none;
  animation: float-glow 25s infinite alternate ease-in-out;
}

.bg-glow-1 {
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  top: -10vw;
  left: -10vw;
}

.bg-glow-2 {
  background: radial-gradient(circle, var(--color-purple) 0%, transparent 70%);
  bottom: -15vw;
  right: -10vw;
  animation-delay: -10s;
}

@keyframes float-glow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(8vw, 6vw) scale(1.15);
  }
  100% {
    transform: translate(-5vw, -3vw) scale(0.9);
  }
}

/* =====================================================================
   ESTRUTURA GLASSMORPHISM (GLASS PANELS E CARDS)
   ===================================================================== */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: var(--transition-smooth);
}

/* =====================================================================
   TELA DE LOGIN GATEWAY
   ===================================================================== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  transform: scale(1);
  animation: scale-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scale-up {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.logo-area {
  text-align: center;
  margin-bottom: 32px;
}

.logo-shield {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  margin-bottom: 16px;
  color: var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.logo-icon {
  width: 32px;
  height: 32px;
  animation: pulse-icon 3s infinite alternate ease-in-out;
}

@keyframes pulse-icon {
  0% { transform: scale(1); }
  100% { transform: scale(1.08) rotate(2deg); color: var(--color-purple); }
}

.logo-area h1 {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fff 30%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.logo-area p {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group label i {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

.input-group input {
  background: rgba(10, 13, 20, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.input-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.login-error-message {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-purple) 100%);
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

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

.btn-primary i {
  width: 18px;
  height: 18px;
}

/* =====================================================================
   PAINEL DASHBOARD PRINCIPAL
   ===================================================================== */
.dashboard-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-slide-down {
  animation: slide-down 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cabeçalho do Dashboard */
.dashboard-header {
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-purple) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.user-info h2 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 600;
}

.user-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Barra de Busca */
.search-bar {
  position: relative;
  width: 320px;
}

.search-bar input {
  width: 100%;
  background: rgba(10, 13, 20, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 16px 10px 40px;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--color-primary);
  width: 380px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.clear-btn:hover {
  color: #fff;
}

.clear-btn i {
  width: 14px;
  height: 14px;
}

/* Botão de Logout */
.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-logout:hover {
  background: var(--color-danger);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-logout i {
  width: 18px;
  height: 18px;
}

/* Seções e Grid */
.services-sections {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.category-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-smooth);
}

.category-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
  padding-left: 4px;
}

.category-title i {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Ajustes de Colunas Responsivas */
@media (max-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-header { flex-direction: column; align-items: stretch; }
  .search-bar { width: 100%; }
  .search-bar input:focus { width: 100%; }
}
@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* Cartões de Serviço Individual (Premium Glassmorphism + Glow) */
.service-card {
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: card-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes card-appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Efeito de Glow dinâmico no hover */
.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.12) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition-smooth);
  pointer-events: none;
}

.service-card:hover .card-glow {
  opacity: 1;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-smooth);
}

.card-icon i {
  width: 22px;
  height: 22px;
}

.service-card h4 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Cores e Customizações por Ícone */
.c-nextcloud { color: #0082c9; background: rgba(0, 130, 201, 0.08) !important; }
.c-openproject { color: #1a6dff; background: rgba(26, 109, 255, 0.08) !important; }
.c-kan { color: #f59e0b; background: rgba(245, 158, 11, 0.08) !important; }
.c-onlyoffice { color: #ff6f3c; background: rgba(255, 111, 60, 0.08) !important; }
.c-chat { color: #10b981; background: rgba(16, 185, 129, 0.08) !important; }
.c-qdrant { color: #ec4899; background: rgba(236, 72, 153, 0.08) !important; }
.c-n8n { color: #ff6b6b; background: rgba(255, 107, 107, 0.08) !important; }
.c-gitlab { color: #fc6d26; background: rgba(252, 109, 38, 0.08) !important; }
.c-portainer { color: #35c5f2; background: rgba(53, 197, 242, 0.08) !important; }
.c-netdata { color: #03a9f4; background: rgba(3, 169, 244, 0.08) !important; }
.c-uptime { color: #e91e63; background: rgba(233, 30, 99, 0.08) !important; }
.c-dozzle { color: #4caf50; background: rgba(76, 175, 80, 0.08) !important; }
.c-superprod { color: #ff5722; background: rgba(255, 87, 34, 0.08) !important; }

.service-card:hover .card-icon {
  transform: scale(1.08) rotate(3deg);
  border-color: currentColor;
  box-shadow: 0 0 10px currentColor;
}

/* Rodapé */
.dashboard-footer {
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* =====================================================================
   UTILITÁRIOS & TRANSISÇÕES DE TELA
   ===================================================================== */
.hidden {
  display: none !important;
}

.opacity-0 {
  opacity: 0;
  pointer-events: none;
}

/* Efeito Ripple de Clique */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Barra de Rolagem Customizada */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-panel);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}
