/* ============================================
   NICHIFY PRO - DASHBOARD CSS
   ============================================ */

/* ============================================
   LAYOUT
   ============================================ */
.dash-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: var(--z-fixed);
  transition: transform var(--transition-base);
}

.sidebar-logo {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-icon {
  font-size: 1.75rem;
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gradient-aurora);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-version {
  font-size: 0.625rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: var(--space-lg);
}

.sidebar-section-title {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px;
  margin-bottom: var(--space-sm);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  margin-bottom: 2px;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.15), rgba(167, 139, 250, 0.1));
  color: var(--text-primary);
  border-left: 3px solid var(--accent-blue);
  padding-left: 9px;
  font-weight: 600;
}

.sidebar-item-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.sidebar-item-badge {
  margin-left: auto;
  font-size: 0.625rem;
  padding: 2px 6px;
}

/* Lifetime Card */
.sidebar-lifetime {
  margin: var(--space-md);
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.1), rgba(167, 139, 250, 0.1));
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: var(--radius-lg);
  text-align: center;
}

.sidebar-lifetime-old {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 0.8125rem;
}

.sidebar-lifetime-price {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin: 4px 0;
}

.sidebar-lifetime-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.sidebar-lifetime-stock {
  font-size: 0.6875rem;
  color: var(--warning);
  margin-top: var(--space-xs);
  font-weight: 600;
}

/* Sidebar User */
.sidebar-user {
  padding: var(--space-md);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-menu {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-user-menu:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-xl);
  min-height: 100vh;
  position: relative;
}

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, rgba(77,163,255,0.12), rgba(167,139,250,0.08));
  border: 1px solid rgba(77,163,255,0.25);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: radial-gradient(circle, rgba(77,163,255,0.15), transparent);
  pointer-events: none;
}

.welcome-content h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.welcome-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.welcome-info {
  text-align: right;
  z-index: 1;
}

.welcome-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 2px;
}

.welcome-info-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Live status bar */
.live-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Search Bar */
.dash-search {
  margin-bottom: var(--space-xl);
}

.dash-search-input {
  position: relative;
  display: flex;
  gap: var(--space-sm);
}

.dash-search-input input {
  flex: 1;
  padding: 16px 20px 16px 52px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all var(--transition-base);
}

.dash-search-input input:focus {
  border-color: var(--accent-blue);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.15);
}

.dash-search-input::before {
  content: '🔍';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.125rem;
  pointer-events: none;
  opacity: 0.6;
  z-index: 1;
}

/* Stats Grid */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (max-width: 1024px) {
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }
}

/* Main Grid (3 columns) */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (max-width: 1200px) {
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

/* Widget */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.widget:hover {
  border-color: var(--border-hover);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.widget-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9375rem;
  font-weight: 700;
}

.widget-title-icon {
  font-size: 1.125rem;
}

.widget-action {
  font-size: 0.75rem;
  color: var(--accent-blue);
  cursor: pointer;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.widget-action:hover {
  color: var(--accent-purple);
}

.widget-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* Channel/Niche Row Items */
.row-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.row-item:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.row-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
  overflow: hidden;
}

.row-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-item-info {
  flex: 1;
  min-width: 0;
}

.row-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.row-item-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-item-score {
  font-size: 1.125rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.row-item-rank {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-left: auto;
}

/* News Item */
.news-item {
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.news-item:hover {
  background: var(--bg-elevated);
  border-left-color: var(--accent-blue);
}

.news-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.news-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  z-index: var(--z-fixed);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main {
    margin-left: 0;
    padding: var(--space-md);
    padding-top: 60px;
  }
  
  .mobile-menu-btn {
    display: inline-flex;
  }
  
  .welcome-banner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
  
  .welcome-info {
    text-align: center;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: calc(var(--z-fixed) - 1);
}

.sidebar-overlay.active {
  display: block;
}
