/* Analytics Page Styles */

.analytics-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header with title and time filter */
.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.analytics-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.time-filter {
  display: flex;
  gap: 8px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.time-filter::-webkit-scrollbar {
  display: none;
}

.time-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.time-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.time-btn.active {
  color: var(--accent-text);
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: #0f0f0f;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  background: #121212;
}

.stat-card.has-toggle {
  position: relative;
  padding-right: 52px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.views {
  background: rgba(85, 97, 234, 0.15);
  color: #5561ea;
}

.stat-icon.sales {
  background: rgba(85, 234, 174, 0.15);
  color: #55eaae;
}

.stat-icon.assets {
  background: rgba(234, 224, 85, 0.15);
  color: #eae055;
}

.stat-icon.commissions {
  background: rgba(234, 85, 189, 0.15);
  color: #ea55bd;
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.stat-toggle {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.stat-toggle-btn {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent-color);
  background: var(--accent-color);
  color: var(--accent-text);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  pointer-events: auto;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
}

.stat-toggle-btn.show {
  opacity: 1;
  visibility: visible;
  background: var(--accent-color);
  color: var(--accent-text);
  border-color: var(--accent-color);
}

.stat-toggle-btn:first-child {
  left: -14px;
}

.stat-toggle-btn:last-child {
  right: -14px;
}

.stat-toggle-btn svg {
  width: 14px;
  height: 14px;
}

.stat-toggle-btn:hover {
  color: var(--accent-text);
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.stat-toggle-btn.active {
  color: var(--accent-text);
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #ffffff80;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-change svg {
  width: 14px;
  height: 14px;
}

.stat-change.positive {
  color: #55eaae;
}

.stat-change.negative {
  color: #ea5555;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  min-width: 0;
}

.chart-card {
  background: #0f0f0f;
  border-radius: 12px;
  padding: 24px;
  min-width: 0;
  overflow: hidden;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.chart-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  flex: 1;
}

.chart-type-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background-color: #151515;
  border-radius: 8px;
  flex-shrink: 0;
}

.chart-type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #ffffff60;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chart-type-btn svg {
  width: 16px;
  height: 16px;
}

.chart-type-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.chart-type-btn.active {
  background-color: var(--accent-color);
  color: var(--accent-text);
}

.chart-type-btn.active:hover {
  background-color: var(--accent-hover);
}

.chart-container {
  height: 250px;
  position: relative;
  width: 100%;
}

/* Analytics Bottom Section */
.analytics-bottom {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
}

.analytics-card {
  background: #0f0f0f;
  border-radius: 12px;
  padding: 24px;
}

/* Top Performing Assets card - flexible height with max based on notifications */
.analytics-card:first-child {
  display: flex;
  flex-direction: column;
  max-height: var(--notifications-height, auto);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.view-all-link {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-color);
  text-decoration: none;
  padding: 6px 14px;
  background-color: var(--accent-15);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.view-all-link:hover {
  background-color: var(--accent-color);
  color: var(--accent-text);
}

/* Assets List */
.assets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.assets-list::-webkit-scrollbar {
  width: 6px;
}

.assets-list::-webkit-scrollbar-track {
  background: transparent;
}

.assets-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.assets-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.asset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #151515;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.asset-item:hover {
  background: #1a1a1a;
}

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

.asset-name {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-revenue {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #55eaae;
  flex-shrink: 0;
  margin-left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.asset-revenue.robux {
  color: #55eaae;
}

.asset-revenue .robux-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Notifications */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background: #151515;
  border-radius: 10px;
  transition: background 0.2s ease;
  gap: 12px;
}

.notification-item:hover {
  background: #1a1a1a;
}

.notification-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 8px;
}

.notification-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #ffffff80;
  line-height: 1.4;
  flex: 1;
}

.notification-time {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #ffffff40;
  margin-top: auto;
  padding-top: 12px;
}

.notification-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #ffffff60;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 12px;
  transition: all 0.2s ease;
}

.notification-delete svg {
  width: 16px;
  height: 16px;
}

.notification-delete:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.notification-delete:active {
  background: rgba(255, 255, 255, 0.12);
}


/* Responsive Styles */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .analytics-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .analytics-section {
    gap: 16px;
  }

  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .analytics-title {
    font-size: 20px;
  }

  .time-filter {
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .time-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    gap: 12px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .stat-icon svg {
    width: 20px;
    height: 20px;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-label {
    font-size: 12px;
  }

  .chart-card,
  .analytics-card {
    padding: 16px;
  }

  .charts-grid {
    gap: 16px;
  }

  .chart-card {
    padding: 12px;
  }

  .chart-container {
    height: 180px;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .chart-type-toggle {
    align-self: flex-end;
    width: 100%;
    justify-content: flex-end;
  }

  .chart-type-btn {
    width: 36px;
    height: 36px;
  }

  .chart-type-btn svg {
    width: 18px;
    height: 18px;
  }

  .asset-item {
    padding: 12px;
  }

  .asset-name {
    font-size: 13px;
  }

  .asset-revenue {
    font-size: 14px;
  }

  .notification-item {
    padding: 12px;
  }

  .notification-title {
    font-size: 13px;
  }

  .notification-desc {
    font-size: 12px;
  }

  .notification-time {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-toggle {
    position: static;
    transform: none;
    display: flex;
    gap: 6px;
    pointer-events: auto;
  }

  .stat-toggle-btn {
    position: static;
  }
}
