/**
 * Dashboard Premium Styles
 * optimized for YO-tengo v1.3.0
 */

/*Variables de Diseño Especiales para el Dashboard */
:root {
  --dash-bg: #f8fafc;
  --dash-card-bg: #ffffff;
  --dash-primary: #3483fa;
  --dash-text: #1e293b;
  --dash-text-muted: #64748b;
  --dash-border: #f1f5f9;
  --dash-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
  --dash-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Modal Content Overrides */
.dashboard-content {
  max-width: 1100px !important;
  width: 95% !important;
  background: var(--dash-bg) !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  border: none !important;
}

/* Layout Principal */
.dashboard-container {
  display: flex;
  height: 85vh;
  min-height: 500px;
  background: var(--dash-bg);
  gap: 0 !important; /* Sidebar pegado */
}

/* Sidebar Estilo Mercado Libre / Apple */
.dashboard-sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid var(--dash-border);
  display: flex;
  flex-direction: column;
  padding: 30px 0;
  flex-shrink: 0;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 25px;
  border: none;
  background: transparent;
  color: var(--dash-text-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.dash-nav-item i {
  width: 20px;
  font-size: 18px;
  text-align: center;
}

.dash-nav-item:hover {
  background: #f1f5f9;
  color: var(--dash-primary);
}

.dash-nav-item.active {
  background: #eff6ff;
  color: var(--dash-primary);
  border-right: 4px solid var(--dash-primary);
}

/* Área de Contenido Principal */
.dashboard-main {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Vistas */
.dash-view {
  display: none;
  animation: dashFadeIn 0.3s ease-out;
}

.dash-view.active {
  display: block;
}

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

.dash-view h3 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--dash-text);
  letter-spacing: -0.025em;
}

/* --- PERFIL PREMIUM --- */
.profile-card-header {
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--dash-shadow);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 30px;
  border: 1px solid var(--dash-border);
}

.profile-avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
}

.profile-avatar-container img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.avatar-badge {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: var(--dash-primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  cursor: pointer;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--dash-shadow);
  border: 1px solid var(--dash-border);
}

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

.dash-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-text-muted);
  text-transform: uppercase;
}

.dash-form-group input,
.dash-form-group select,
.dash-form-group textarea {
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s;
}

.dash-form-group input:focus {
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px rgba(52, 131, 250, 0.1);
  outline: none;
}

/* --- ORDENES PREMIUM --- */
.user-order-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--dash-border);
  box-shadow: var(--dash-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.user-order-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--dash-shadow-lg);
}

.order-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f8fafc;
}

.order-id-group h4 {
  margin: 0;
  font-size: 17px;
  color: var(--dash-text);
}

.order-date {
  font-size: 13px;
  color: var(--dash-text-muted);
}

.order-status-tag {
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-shipped {
  background: #e0f2fe;
  color: #0369a1;
}
.status-paid {
  background: #dcfce7;
  color: #166534;
}
.status-pending {
  background: #fef3c7;
  color: #92400e;
}

/* Item List inside Order */
.dash-order-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.dash-mini-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.dash-mini-item-img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #f1f5f9;
}

.dash-mini-item-info h5 {
  margin: 0;
  font-size: 15px;
  color: var(--dash-text);
}

.dash-mini-item-info span {
  font-size: 12px;
  color: var(--dash-text-muted);
}

/* --- RESPONSIVE MOBILE FIRST --- */
@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column;
    height: auto;
    min-height: 90vh;
  }

  .dashboard-sidebar {
    width: 100%;
    flex-direction: row;
    padding: 0;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--dash-border);
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .dash-nav-item {
    padding: 15px 20px;
    width: auto;
    white-space: nowrap;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
    text-align: center;
    border-right: none !important;
  }

  .dash-nav-item i {
    font-size: 20px;
  }

  .dash-nav-item.active {
    border-bottom: 3px solid var(--dash-primary);
    background: white;
  }

  .dashboard-main {
    padding: 20px;
  }

  .profile-card-header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

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

  .dash-view h3 {
    font-size: 22px;
  }
}

/* Dark Mode Support (Basic) */
@media (prefers-color-scheme: dark) {
  body.dark-mode .dashboard-content {
    background: #1a202c !important;
  }
  body.dark-mode .dashboard-sidebar {
    background: #2d3748;
    border-color: #4a5568;
  }
  body.dark-mode .dash-nav-item:hover {
    background: #4a5568;
  }
  body.dark-mode .dashboard-main,
  body.dark-mode .profile-card-header,
  body.dark-mode .profile-form-grid,
  body.dark-mode .user-order-card {
    background: #2d3748;
    color: white;
    border-color: #4a5568;
  }
}

/* --- ANIMACIONES PREMIUM EXTRA --- */
.heart-pop {
    animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.order-new-flash {
    animation: orderFlash 2s ease-out;
}

@keyframes orderFlash {
    0% { background-color: #eff6ff; border-color: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.3); }
    100% { background-color: white; border-color: var(--dash-border); box-shadow: var(--dash-shadow); }
}

.shimmer-effect {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.notif-item.unread {
    position: relative;
    border-left: 3px solid var(--dash-primary);
}
