/* ==============================================================================
   YouWebAR - Design System & UI Kit
   Paleta y arte heredado de WebAR Studio (Suite of Art):
   - Fondos sólidos Google Dark (#131314, #18191c, #1e1f23, #202226)
   - Acentos y branding Oro Suite of Art (#c5a059, #b38e46, #eed09e)
   - Tipografía Poppins
   - Estructura limpia de controles y botones sin gradientes artificiales
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  /* YouWebAR Mint & Emerald Palette */
  --brand-mint: #00d09c;
  --brand-mint-hover: #00b887;
  --brand-mint-dark: #00966d;
  --brand-mint-light: #7df8d4;
  --brand-mint-tint: rgba(0, 208, 156, 0.12);
  --brand-mint-border: rgba(0, 208, 156, 0.35);

  /* Brand Palette (Mapped to YouWebAR Mint) */
  --brand-gold: #00d09c;
  --brand-gold-hover: #00b887;
  --brand-gold-dark: #00966d;
  --brand-gold-light: #7df8d4;
  --brand-gold-tint: rgba(0, 208, 156, 0.12);
  --brand-gold-border: rgba(0, 208, 156, 0.35);

  /* Google Dark Solid Surfaces (No neon, no blurry AI gradients) */
  --bg-primary: #131314;
  --bg-secondary: #18191c;
  --bg-card: #1e1f23;
  --bg-card-hover: #25272c;
  --bg-surface: #202226;
  --bg-input: #141517;

  /* Outlines & Borders - Crisp 1px solid borders */
  --border-subtle: #2d3036;
  --border-focus: #00d09c;
  --border-hover: #3f4249;
  --border-glass: #2d3036;

  /* Primary Action */
  --accent-primary: #00d09c;
  --accent-primary-hover: #00b887;
  --accent-gradient: linear-gradient(135deg, #7df8d4 0%, #00d09c 50%, #00966d 100%);
  --accent-glow: rgba(0, 208, 156, 0.28);

  /* Text Colors */
  --text-main: #f0f1f4;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --text-inverse: #0e0f12;

  /* Functional Status Accents */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.45);

  --transition-smooth: all 0.2s ease;
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ==============================================================================
   Solid Surface Card Utility (Sustituye a Glassmorphism ruidoso)
   ============================================================================== */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* ==============================================================================
   Sistema de Botones Jerarquizado
   ============================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

/* Botón Primario: YouWebAR Mint */
.btn-primary, .btn-gold {
  background: var(--brand-mint, #00d09c);
  border-color: var(--brand-mint-hover, #00b887);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 208, 156, 0.35);
}

.btn-primary:hover, .btn-gold:hover {
  background: var(--brand-mint-hover, #00b887);
  border-color: var(--brand-mint-dark, #008762);
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(0, 208, 156, 0.45);
}

/* Botón Secundario: Superficie Oscura Google */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: #ffffff;
}

/* Botón Icono Cuadrado / Acción Rápida */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

/* Botón Peligro / Papelera */
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

/* ==============================================================================
   Formularios y Controles
   ============================================================================== */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 2px var(--brand-gold-tint);
}

.form-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* ==============================================================================
   Badges y Pastillas de Estado
   ============================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

.badge-gold {
  background: var(--brand-gold-tint);
  color: var(--brand-gold);
  border: 1px solid var(--brand-gold-border);
}

.badge-quickar {
  background: var(--brand-mint-tint, rgba(0, 208, 156, 0.12));
  color: var(--brand-mint-light, #7df8d4);
  border: 1px solid var(--brand-mint-border, rgba(0, 208, 156, 0.35));
}

.badge-marker {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-world {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-geo {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==============================================================================
   Navbar / Header Superior
   ============================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.navbar-brand img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

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

/* Perfil de Usuario en Header */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 12px 4px 4px;
}

.user-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: var(--brand-gold-tint);
  border: 1px solid var(--brand-gold-border);
  color: var(--brand-gold);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==============================================================================
   Layout & Contenedor Principal
   ============================================================================== */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px;
  width: 100%;
}

/* Barra de bienvenida / Encabezado de página */
.welcome-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}

.welcome-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.welcome-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* Métricas / Stats Cards */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--brand-gold-tint);
  color: var(--brand-gold);
  border: 1px solid var(--brand-gold-border);
  flex-shrink: 0;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==============================================================================
   Pestañas de Navegación del Dashboard
   ============================================================================== */
.tabs-container {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0;
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #ffffff;
  border-bottom: 2px solid var(--brand-gold);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
}

/* ==============================================================================
   Barra de Filtros, Búsqueda y Vistas
   ============================================================================== */
.search-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 380px;
}

.search-input-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.95rem;
}

.search-input-wrapper input {
  padding-left: 36px;
  height: 38px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.filter-pill.active {
  background: var(--brand-gold);
  border-color: var(--brand-gold-hover);
  color: var(--text-inverse);
  font-weight: 600;
}

.view-toggles {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ==============================================================================
   Tarjetas de Proyecto (Grid & List)
   ============================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 22px;
  margin-top: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  position: relative;
  border-radius: var(--radius-md);
  min-width: 0;
  overflow: visible;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

/* Thumbnail */
.project-card-thumb {
  width: 100%;
  height: 165px;
  background-color: #0c0d10;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-card-thumb img {
  transform: scale(1.03);
}

.project-card-thumb .fallback-icon {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.15);
}

.project-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-bottom: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.project-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ==============================================================================
   Estructura Mejorada de Botones en la Tarjeta de Proyecto
   ============================================================================== */
.project-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

/* Fila 1: Botón de Acción Principal */
.action-row-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.action-row-primary .btn-action-main {
  flex: 1;
  height: 38px;
  font-size: 0.88rem;
  font-weight: 600;
  gap: 8px;
}

/* Fila 2: Barra de Herramientas Rápidas (QR, Compartir, Embed, Dropdown) */
.action-row-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.action-tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-tools-group .btn-icon {
  width: 34px;
  height: 34px;
  font-size: 0.9rem;
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

.action-tools-group .btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-gold-border);
  color: var(--brand-gold);
}

/* Botón 3-Puntos y Dropdown Menú */
.dropdown-menu-wrapper {
  position: relative;
}

.project-menu-btn {
  width: 34px;
  height: 34px;
  font-size: 0.9rem;
}

.dropdown-menu-custom {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  min-width: 195px;
  background: #18191c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  padding: 6px;
  display: none;
}

.dropdown-menu-custom.show {
  display: block;
}

.dropdown-item-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
}

.dropdown-item-custom:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.dropdown-item-custom.danger {
  color: #f87171;
}

.dropdown-item-custom.danger:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.dropdown-divider-custom {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 5px 0;
}

/* ==============================================================================
   Modo Lista (List View)
   ============================================================================== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.project-list .project-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 20px;
}

.project-list .project-card-thumb {
  width: 72px;
  height: 52px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.project-list .project-card-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.project-list .project-desc {
  display: none;
}

.project-list .project-meta {
  border-top: none;
  padding-top: 0;
  margin-bottom: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.project-list .project-card-actions {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.project-list .action-row-primary {
  width: auto;
}

.project-list .action-row-tools {
  width: auto;
}

.project-list .dropdown-menu-custom {
  bottom: auto;
  top: calc(100% + 6px);
}

/* ==============================================================================
   Modales
   ============================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-width: 600px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  animation: modalIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ==============================================================================
   Dropzone Upload Box
   ============================================================================== */
.dropzone-box {
  border: 1px dashed var(--brand-gold-border);
  background: var(--brand-gold-tint);
  border-radius: var(--radius-sm);
  padding: 24px 18px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--brand-mint, #00d09c);
  background: var(--brand-mint-tint, rgba(0, 208, 156, 0.12));
}
