/* ==========================================================================
   VIEIRA VIDROS & ESQUADRIAS - ADMIN DASHBOARD STYLES
   Paleta: Grafite Nobre & Dourado Metálico
   ========================================================================== */

:root {
  --bg-dark: #0A0C0E;
  --bg-surface: #12151A;
  --bg-card: #181C23;
  --bg-card-hover: #202630;
  --bg-input: #0E1116;
  --bg-glass: rgba(24, 28, 35, 0.85);

  --color-border: rgba(212, 175, 55, 0.2);
  --color-border-glow: rgba(212, 175, 55, 0.5);
  --color-border-subtle: rgba(255, 255, 255, 0.08);

  --color-gold: #D4AF37;
  --color-gold-light: #F3E5AB;
  --color-gold-dark: #AA820A;
  --gradient-gold: linear-gradient(135deg, #F3E5AB 0%, #D4AF37 50%, #AA820A 100%);
  --gradient-gold-subtle: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(170, 130, 10, 0.05) 100%);

  --color-text-main: #F8F9FA;
  --color-text-muted: #9AA0A8;
  --color-danger: #EF4444;
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-success: #10B981;
  --color-success-bg: rgba(16, 185, 129, 0.15);

  --font-family: 'Poppins', sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--color-text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.04) 0%, transparent 40%);
}

/* ==========================================================================
   TELA DE LOGIN
   ========================================================================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(212, 175, 55, 0.1);
  backdrop-filter: blur(16px);
  animation: fadeIn 0.4s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(212, 175, 55, 0.3));
}

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ==========================================================================
   PAINEL PRINCIPAL (DASHBOARD)
   ========================================================================== */
.admin-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 14px 24px;
}

.admin-nav-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text-main);
}

.admin-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.admin-brand-info h2 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.admin-brand-info span {
  font-size: 0.75rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--color-border-subtle);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.user-badge i {
  color: var(--color-gold);
}

/* Main Content */
.admin-main {
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 60px;
  flex: 1;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-title-group h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.admin-title-group p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Metrics row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--color-border);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--gradient-gold-subtle);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  font-size: 1.25rem;
}

.stat-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

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

/* Layout 2 Colunas */
.admin-layout-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1024px) {
  .admin-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Genérico */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.panel-card-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-card-header h2 i {
  color: var(--color-gold);
}

/* ==========================================================================
   FORMULÁRIOS & CAMPOS
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.form-label span.req {
  color: var(--color-gold);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--color-text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Dropzone de Upload de Imagem */
.upload-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background: rgba(212, 175, 55, 0.02);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--color-gold);
  background: rgba(212, 175, 55, 0.07);
}

.upload-dropzone i {
  font-size: 2.2rem;
  color: var(--color-gold);
  margin-bottom: 10px;
  display: inline-block;
}

.upload-dropzone p {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.upload-dropzone small {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.upload-input-file {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Preview da imagem selecionada */
.image-preview-box {
  position: relative;
  margin-top: 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #000;
  aspect-ratio: 16 / 10;
  display: none;
}

.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-preview {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-remove-preview:hover {
  background: var(--color-danger);
  color: #fff;
}

/* Barra de Progresso de Upload */
.upload-progress-container {
  display: none;
  margin-top: 14px;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-gold);
  border-radius: 999px;
  transition: width 0.2s ease;
}

/* ==========================================================================
   BOTÕES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-gold {
  background: var(--gradient-gold);
  color: #0D0F12;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

.btn-gold:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-gold:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-gold-light);
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-gold);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  color: var(--color-text-main);
  background: var(--bg-card-hover);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid transparent;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.btn-danger-ghost:hover {
  background: var(--color-danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   LISTA DE PROJETOS NO ADMIN
   ========================================================================== */
.projects-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.project-admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.project-admin-card:hover {
  border-color: var(--color-border);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.project-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: #000;
}

.project-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  color: var(--color-gold);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
}

.project-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card-local {
  font-size: 0.78rem;
  color: var(--color-gold);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.project-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-subtle);
  margin-top: auto;
}

.project-card-date {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* Estado vazio */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  border: 2px dashed var(--color-border-subtle);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: var(--color-gold);
  opacity: 0.5;
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  font-size: 1.15rem;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

/* ==========================================================================
   TOAST / NOTIFICAÇÕES FLUTUANTES
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
  max-width: 400px;
}

.toast.toast-success i { color: var(--color-success); }
.toast.toast-error i { color: var(--color-danger); }
.toast.toast-info i { color: var(--color-gold); }

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
