/**
 * Musiveo Stats Hub Dashboard CSS
 */

:root {
  --mshub-primary: #260056;
  --mshub-secondary: #3CAEA3;
  --mshub-background: #000000;
  --mshub-card-bg: #020202;
  --mshub-text: #FFFFFF;
  --mshub-text-secondary: #B0B0B0;
  --mshub-border: rgb(162 162 162 / 10%);
  --mshub-hover: #1a1a1a;
  --mshub-success: #4CAF50;
  --mshub-danger: #f44336;
  --mshub-warning: #ff9800;
  --mshub-border-radius: 8px;
  --mshub-transition: all 0.3s ease;
}

/* Dashboard Base */
.mshub-dashboard {
  max-width: 95% !important;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: var(--mshub-background) !important;
  color: var(--mshub-text) !important;
}

/* Dashboard Header */
.mshub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--mshub-border);
}

.mshub-user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mshub-avatar img {
  border-radius: 50%;
  width: 64px;
  height: 64px;
}

.mshub-user-details h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.5em;
  color: var(--mshub-text-primary);
}

.mshub-user-role {
  display: none;
}

/* Loading Overlay */
.mshub-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.mshub-loading-spinner,
.mshub-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--mshub-border);
  border-top-color: var(--mshub-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Musiveo Stats Section */
.mshub-musiveo-stats {
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
}

.mshub-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
	background: #050505;
}

.mshub-stat-item {
    flex: 1;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 1px;
}

.mshub-stat-value, .stat-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.mshub-stat-description {
    font-size: 13px;
    color: #aaa;
}

.mshub-section-title {
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mshub-section-title h3 {
    font-size: 18px;
    color: #fff;
    margin: 0;
}

/* Platform Stats */
.mshub-platform-metrics {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.mshub-platform-error {
    flex: 1;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 13px;
    text-align: center;
}

.mshub-metric {
    flex: 1;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
}

.platform-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
}

.platform-status.online {
    background: #2ecc71;
    color: #fff;
}

.platform-status.offline {
    background: #e74c3c;
    color: #fff;
}

.live-viewers {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #2ecc71;
}

/* Chart Styles */
.mshub-charts-section {
    margin-bottom: 30px;
}

.mshub-charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.mshub-charts-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
}

.mshub-range-filter {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 3px;
}

.mshub-range-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mshub-range-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.mshub-range-btn.active {
    color: #fff;
    background: var(--mshub-primary);
}

.mshub-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .mshub-charts-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.mshub-chart-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 8px;
}

.mshub-chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: unset;
    min-height: 150px;
    height: 100%;
    max-height: 200px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0;
    display: block;
    padding: 14px 12px 10px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #222;
}

.mshub-chart-container canvas {
    width: 100%;
    height: 100%;
    min-width: 100%;
    max-width: 100%;
    max-height: 170px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    background: #020202;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
    border: none;
}

.mshub-chart-container .legend, .mshub-chart-container .chartjs-legend {
    margin-top: 12px;
    text-align: left;
    font-size: 14px;
    color: #ccc;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

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

.mshub-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.mshub-select:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Platform Cards */
.mshub-platform-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.mshub-platform-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.mshub-platform-header img {
    width: 32px;
    height: 32px;
}

.mshub-platform-header h3 {
    margin: 0;
    font-size: 18px;
}

.mshub-platform-description {
    color: #888;
    font-size: 14px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mshub-stat-row {
        flex-direction: column;
    }

    .mshub-platform-metrics {
        flex-direction: column;
    }

    .mshub-charts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 12px;
    }

    .mshub-range-filter {
        flex-wrap: wrap;
    }

    .mshub-charts-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .mshub-chart-container {
        min-height: 150px;
        max-height: 200px;
        height: auto;
        padding: 10px 8px 8px 8px;
        margin-bottom: 12px;
    }
    .mshub-chart-container canvas {
        width: 100% !important;
        height: 170px !important;
        min-height: 130px;
        max-height: 170px;
        display: block;
        margin: 0 auto;
    }
    .mshub-chart-container .legend, .mshub-chart-container .chartjs-legend {
        flex-direction: column;
        gap: 8px;
        font-size: 13px;
        margin-top: 10px;
    }
}

/* Stats Overview */
.mshub-stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.mshub-stat-card {
  background: var(--mshub-card-bg);
  padding: 20px;
  border-radius: var(--mshub-border-radius);
  border: 1px solid var(--mshub-border);
  transition: transform 0.2s ease;
}

.mshub-stat-card:hover {
  transform: translateY(-2px);
}

.mshub-stat-card h3 {
  margin: 0 0 10px;
  color: var(--mshub-text-secondary);
  font-size: 16px;
}

.mshub-stat-trend {
  font-size: 14px;
  color: var(--mshub-text-secondary);
}

/* Chart Container */
.mshub-chart-container {
  background: var(--mshub-card-bg);
  border-radius: var(--mshub-border-radius);
  border: 1px solid var(--mshub-border);
  padding: 20px;
  margin-bottom: 30px;
  height: auto;
  max-height: 600px;
}

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

.mshub-chart-info h3 {
  margin: 0 0 8px;
  color: var(--mshub-text);
  font-size: 18px;
}

.mshub-chart-info p {
  margin: 0;
  color: var(--mshub-text-secondary);
  font-size: 14px;
}

.mshub-chart-controls {
  min-width: 150px;
}

.mshub-select:focus {
  outline: none;
  border-color: var(--mshub-primary);
}

.mshub-chart-wrapper {
  height: 400px;
  max-height: 500px;
  position: relative;
  margin-top: 20px;
}

#stats-chart {
  width: 100%;
  height: 400px !important;
  max-height: 400px !important;
}

/* Optimize chart rendering */
canvas {
  image-rendering: optimizeSpeed;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-contrast;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mshub-chart-header {
    flex-direction: column;
    gap: 15px;
  }

  .mshub-chart-controls {
    width: 100%;
}

.mshub-chart-container {
    max-height: 500px;
}

.mshub-chart-wrapper {
  height: 300px;
  max-height: 400px;
}

  #stats-chart {
    height: 300px !important;
  max-height: 400px !important;
}

  .mshub-user-info {
    display: contents;
  }
}

/* Platform Stats */
.mshub-platform-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.mshub-platform-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mshub-platform-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.mshub-platform-header img {
  width: 32px;
  height: 32px;
  margin-right: 12px;
}

.mshub-platform-header h3 {
  margin: 0;
  font-size: 1.4em;
  color: #333;
}

.mshub-platform-description {
  margin: 8px 0 0 44px;
  color: #666;
  font-size: 0.9em;
}

/* Channel/Artist Info */
.mshub-channel-info,
.mshub-artist-info {
  margin-top: 20px;
}

.mshub-channel-header,
.mshub-artist-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.mshub-channel-avatar,
.mshub-artist-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-right: 16px;
  object-fit: cover;
}

.mshub-channel-details,
.mshub-artist-details {
  flex: 1;
}

.mshub-channel-details h4,
.mshub-artist-details h4 {
  margin: 0 0 8px;
  font-size: 1.2em;
  color: #333;
}

.mshub-channel-handle,
.mshub-spotify-link {
  color: #666;
  text-decoration: none;
  font-size: 0.9em;
}

.mshub-channel-handle:hover,
.mshub-spotify-link:hover {
  color: #1db954;
}

.mshub-artist-genres {
  margin: 8px 0;
}

.mshub-genre-tag {
  display: inline-block;
  padding: 4px 8px;
  margin: 0 4px 4px 0;
  background: #f0f0f0;
  border-radius: 12px;
  font-size: 0.8em;
  color: #666;
}

/* Platform Metrics */
.mshub-platform-metrics {
  margin-bottom: 24px;
  background: #151515;
  border-radius: 8px;
  padding: 15px;
  width: 100%;
  box-sizing: border-box;
}

.mshub-metrics-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.mshub-metric {
  flex: 1;
  min-width: 150px;
  text-align: center;
  padding: 12px;
  background: #1a1a1a !important;
  border-radius: 8px;
  color: #fff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-label {
  display: block;
  color: #B0B0B0 !important;
  font-size: 0.85em;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.platform-subscribers,
.platform-views,
.platform-videos,
.platform-followers,
.platform-popularity {
  display: block;
  font-size: 1.4em;
  font-weight: bold;
  color: #fff !important;
  margin: 6px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hide metric descriptions */
.metric-description {
  display: none;
}

/* Hide disconnect button in stats boxes */
.mshub-platform-metrics .mshub-disconnect-button,
.mshub-metrics-row .mshub-disconnect-button {
  display: none !important;
}

/* Video Grid */
.mshub-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.mshub-video-card {
  background: #151515 !important;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

.mshub-video-info {
  padding: 15px;
  background: #151515 !important;
}

.video-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.video-title {
  margin: 0;
  font-size: 14px;
  color: #fff;
  flex: 1;
  line-height: 1.4;
}

.copy-url {
  background: none;
  border: none;
  padding: 0;
  color: #666;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
}

.copy-url:hover {
  opacity: 1;
}

.copy-url .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.video-stats {
  display: flex;
  gap: 15px;
  color: #808080;
  font-size: 12px;
}

.video-views, .video-likes {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mshub-metrics-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .mshub-metric {
    flex: 1 1 calc(50% - 10px);
    min-width: 120px;
  }

  .platform-subscribers,
  .platform-views,
  .platform-videos,
  .platform-followers,
  .platform-popularity {
    font-size: 1.2em;
  }
}

/* Track Grid */
.mshub-track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Track Card Layout */
.mshub-track-card {
    background: #151515 !important;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
}

.mshub-track-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.mshub-track-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.mshub-track-info {
    flex: 1;
    min-width: 0;
    background: transparent !important;
    padding: 0;
}

.mshub-track-title {
    margin: 0 0 5px;
    font-size: 14px;
    line-height: 1.4;
}

.mshub-track-title a {
    color: #fff;
    text-decoration: none;
}

.mshub-album-name {
    color: #808080;
    font-size: 12px;
    margin: 0;
}

.mshub-track-stats {
  display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
    font-size: 12px;
    color: #808080;
}

.mshub-track-streams,
.mshub-track-popularity {
  display: flex;
  align-items: center;
    gap: 5px;
}

.mshub-track-stats .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Hide disconnect button in all stats boxes */
.mshub-platform-metrics .mshub-disconnect-button,
.mshub-metrics-row .mshub-disconnect-button,
.mshub-artist-header .mshub-disconnect-button {
    display: none !important;
}

/* Popular Content */
.mshub-popular-content {
  margin-top: 24px;
}

.mshub-popular-content h4 {
  margin: 0 0 16px;
  font-size: 1.1em;
  color: #333;
}

.mshub-video-grid,
.mshub-track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.mshub-video-card,
.mshub-track-card {
  background: #151515 !important;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mshub-video-card:hover,
.mshub-track-card:hover {
  transform: translateY(-2px);
}

.mshub-video-card img,
.mshub-track-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.mshub-video-card h5,
.mshub-track-card h5 {
  margin: 12px;
  font-size: 1em;
  color: #333;
  line-height: 1.4;
}

.mshub-video-stats,
.mshub-track-stats {
  display: flex;
  justify-content: space-between;
  padding: 0 12px 12px;
  color: #666;
  font-size: 0.8em;
}

.mshub-track-info {
  padding: 12px;
}

.mshub-album-name {
  margin: 4px 0 8px;
  color: #666;
  font-size: 0.9em;
}

.mshub-preview-player {
  width: 100%;
  margin-top: 8px;
  height: 32px;
}

/* Platform Connect Form */
.mshub-platform-connect {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
}

.mshub-input-group {
  margin-bottom: 16px;
}

.mshub-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1em;
}

.mshub-input-description {
  margin: 8px 0 0;
  color: #666;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Platform-specific colors */
.youtube-stats .mshub-button {
  background: #ff0000;
  color: #fff;
}

.spotify-stats .mshub-button {
  background: #1db954;
  color: #fff;
}

.mshub-disconnect-button {
  background: #dc3545 !important;
}

/* Content Section */
.mshub-content-section {
  margin-bottom: 30px;
}

.mshub-content-section h4 {
  color: var(--mshub-text);
  margin: 0 0 15px;
  font-size: 18px;
  border-bottom: 1px solid var(--mshub-border);
  padding-bottom: 10px;
}

.mshub-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.mshub-content-card {
  background: #020202;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.mshub-content-card:hover {
  transform: translateY(-2px);
}

.mshub-content-thumb {
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.mshub-content-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mshub-content-type {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  text-transform: capitalize;
}

.mshub-content-info {
  padding: 15px;
}

.mshub-content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.mshub-content-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.mshub-content-title a {
  color: #fff;
  text-decoration: none;
}

.mshub-content-title a:hover {
  color: #7B68EE;
}

.mshub-content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.mshub-content-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #B0B0B0;
  font-size: 13px;
}

.mshub-content-meta .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.mshub-content-description {
  color: #808080;
  font-size: 13px;
  line-height: 1.4;
}

/* No Content Message */
.mshub-no-content {
  text-align: center;
  padding: 30px;
  color: #808080;
  background: #151515;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Section Headers */
.mshub-content-section h4 {
  color: #fff;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Platform status indicators */
.platform-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 10px;
}

.status-live {
  background-color: #ff4444;
  color: white;
}

.status-offline {
  background-color: #666;
  color: white;
}

.stream-viewers {
  font-size: 14px;
  color: #666;
  margin-left: 10px;
}

/* Total stats section */
.mshub-total-stats {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #151515;
  border-radius: 8px;
}

.mshub-stat-item {
  text-align: center;
}

.mshub-stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #979797;
  margin-bottom: 5px;
  margin-left: 4px;
  padding-inline: inherit;
}

.mshub-stat-label {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
}

/* Platform Connections */
.mshub-connected-platforms {
  max-width: 800px;
  margin: 0 auto 30px;
  background: var(--mshub-card-bg);
  padding: 20px;
  border-radius: var(--mshub-border-radius);
  border: 1px solid var(--mshub-border);
}

.mshub-platform-card {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background: #050505;
  padding: 15px;
  border-radius: var(--mshub-border-radius);
  border: 1px solid var(--mshub-border);
  margin-bottom: 15px;
  float: inline-start;
}

.mshub-platform-card:last-child {
  margin-bottom: 0;
}

.mshub-platform-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mshub-platform-info img {
  width: 24px;
  height: 24px;
  filter: invert(1);
}

.mshub-platform-info h4 {
  margin: 0;
  color: var(--mshub-text);
}

.mshub-platform-connect {
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.mshub-input-group {
  margin-bottom: 15px;
}

.mshub-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 10px;
}

.mshub-input:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.mshub-input-description {
  font-size: 13px;
  color: #666;
  margin: 5px 0 15px;
  line-height: 1.4;
  padding-left: 10px;
  border-left: 3px solid #ddd;
}

.mshub-connect-button {
  background-color: #4CAF50;
  color: white;
}

.mshub-disconnect-button {
  background-color: #f44336;
  color: white;
}

.mshub-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.mshub-button:not(:disabled):hover {
  opacity: 0.9;
}

/* Platform-specific colors */
.platform-youtube .mshub-connect-button {
  background: #FF0000;
}

.platform-spotify .mshub-connect-button {
  background: #1DB954;
}

.platform-twitch .mshub-connect-button {
  background: #9146FF;
}

.platform-musiveo .mshub-connect-button {
  background: #7B68EE;
}

/* Error Message */
.mshub-error-message {
  background: var(--mshub-card-bg);
  border: 1px solid var(--mshub-danger);
  color: var(--mshub-danger);
  padding: 15px;
  border-radius: var(--mshub-border-radius);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mshub-error-message .dashicons {
  font-size: 20px;
}

.mshub-retry-btn {
  margin-left: auto;
  background: var(--mshub-danger);
  color: var(--mshub-text);
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--mshub-transition);
}

.mshub-retry-btn:hover {
  opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
  .mshub-dashboard {
    padding: 15px;
  }

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

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

  .mshub-platform-connect {
    flex-direction: column;
    width: 100%;
  }

  .mshub-platform-input {
    width: 100%;
  }

  .mshub-content-grid {
    grid-template-columns: 1fr;
  }

  .mshub-content-meta {
    flex-wrap: wrap;
  }
}

/* Section Header */
.mshub-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.mshub-section-header h3 {
  margin: 0;
}

.mshub-button {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--mshub-primary);
  color: var(--mshub-text);
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--mshub-transition);
  margin-left: 4px !important;
  min-width: 110px !important;
}

.mshub-button:hover {
  opacity: 0.9;
}

.mshub-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Message Styles */
.mshub-message {
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 4px;
  display: flex;
  align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-in-out;
}

.mshub-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.mshub-message.success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

.mshub-message .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.mshub-message-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.mshub-message-close {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
  font-size: 18px;
    line-height: 1;
}

.mshub-message-close:hover {
    opacity: 1;
}

/* Platform Connection Status */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

.connected .connection-status {
    background-color: #dcfce7;
    color: #166534;
}

.disconnected .connection-status {
    background-color: #fee2e2;
    color: #991b1b;
}

.connecting .connection-status {
    background-color: #fef3c7;
    color: #92400e;
}

/* Platform Profile Card */
.platform-profile-card {
    background: #fff;
    border: 1px solid #e5e7eb;
  border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.platform-profile-card .description {
    margin: 10px 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}

.platform-profile-card .description.error {
    color: #991b1b;
    background-color: #fee2e2;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 5px;
}

.platform-profile-card .description.success {
    color: #166534;
    background-color: #dcfce7;
  padding: 8px 12px;
    border-radius: 4px;
    margin-top: 5px;
}

.platform-profile-card code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
  font-size: 12px;
    color: #374151;
}

/* Button Styles */
.connect-button,
.disconnect-button {
    display: inline-flex;
  align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 4px;
  font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.connect-button {
    background-color: #3b82f6;
    color: white;
    border: none;
}

.connect-button:hover {
    background-color: #2563eb;
}

.disconnect-button {
    background-color: #ef4444;
    color: white;
    border: none;
}

.disconnect-button:hover {
    background-color: #dc2626;
}

.connect-button:disabled,
.disconnect-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Track Card Enhancements */
.mshub-dashboard .mshub-track-card {
  background: #151515 !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

.mshub-dashboard .mshub-track-info {
    padding: 15px;
  color: #fff;
}

.mshub-dashboard .mshub-track-info h5 {
  color: #fff !important;
  margin: 0 0 8px 0;
  font-size: 1.1em;
  line-height: 1.4;
}

.mshub-dashboard .mshub-album-name {
  color: #B0B0B0 !important;
  margin: 0 0 10px 0;
  font-size: 0.9em;
}

.mshub-dashboard .mshub-release-date {
  color: #888 !important;
  margin-left: 5px;
}

.mshub-dashboard .mshub-track-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mshub-dashboard .mshub-track-stats span {
  color: #B0B0B0 !important;
  font-size: 0.85em;
}

.mshub-dashboard .mshub-preview-player {
  width: 100%;
  margin-top: 12px;
  height: 32px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.mshub-dashboard .mshub-preview-player:hover {
  opacity: 1;
}

/* Platform Sections */
.mshub-dashboard .mshub-platform-section {
  background: #020202 !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff !important;
  height: fit-content;
}

.mshub-dashboard .mshub-platform-header h3 {
  color: #fff !important;
}

.mshub-dashboard .mshub-platform-description {
  color: #B0B0B0 !important;
}

/* Force dark theme for all elements */
.mshub-dashboard * {
  box-sizing: border-box;
  max-width: 95vw;
}

.twitch-stats .mshub-platform-metrics {
  margin: 24px 0;
}

.twitch-stats .mshub-platform-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    width: 100%;
}

.twitch-stats .mshub-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: var(--mshub-card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.twitch-stats .metric-label {
    font-size: 0.9rem;
    color: var(--mshub-text-secondary);
    margin-bottom: 0.5rem;
}

.twitch-stats .platform-status,
.twitch-stats .platform-subscribers,
.twitch-stats .platform-viewers {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--mshub-text-primary);
}

.twitch-stats .platform-status.online {
    color: #2ecc71;
}

.twitch-stats .platform-status.offline {
    color: #e74c3c;
}

@media (max-width: 768px) {
    .twitch-stats .mshub-platform-metrics {
        grid-template-columns: 1fr;
    }
}

/* Chart container styles */
.mshub-chart-container {
    background: var(--mshub-card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mshub-chart-wrapper {
    margin-top: 1rem;
    background: var(--mshub-card-bg);
    border-radius: 8px;
    padding: 1rem;
}

.mshub-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mshub-chart-info h3 {
    margin: 0;
    color: var(--mshub-text-primary);
    font-size: 1.2rem;
}

.mshub-chart-info p {
    margin: 0.5rem 0 0;
    color: var(--mshub-text-secondary);
    font-size: 0.9rem;
}

.mshub-chart-controls .mshub-select {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--mshub-border-color);
    background: var(--mshub-input-bg);
    color: var(--mshub-text-primary);
    font-size: 0.9rem;
}

/* Tooltip styling */
.tooltip {
    position: absolute;
    z-index: 1070;
    display: block;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s;
}

.tooltip.show {
    opacity: 1;
}

.tooltip-inner {
    max-width: 200px;
    padding: 3px 8px;
    color: #fff;
    text-align: center;
    background-color: #000;
    border-radius: 4px;
}

.btn-more {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: var(--mshub-text-secondary);
    transition: color 0.2s ease;
}

.btn-more:hover {
    color: var(--mshub-text-primary);
}

.btn-more .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.mshub-more-options-menu {
    position: absolute;
    background: var(--mshub-bg-secondary);
    border: 1px solid var(--mshub-border-color);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 150px;
}

.mshub-more-options-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mshub-more-options-menu li {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mshub-more-options-menu li:hover {
    background-color: var(--mshub-hover-bg);
}

.mshub-more-options-menu a {
    color: var(--mshub-text-primary);
    text-decoration: none;
    display: block;
}

.mshub-more-options-menu a.delete {
    color: var(--mshub-danger);
}

.mshub-load-more-container {
    text-align: center;
    margin: 20px 0;
    justify-items: center;
}

#load-more-content {
    padding: 10px 20px;
    background-color: var(--mshub-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#load-more-content:hover {
    background-color: var(--mshub-primary-dark);
}

#load-more-content:disabled {
    background-color: var(--mshub-disabled);
    cursor: not-allowed;
}

.mshub-spin {
    animation: mshub-spin 1s linear infinite;
}

@keyframes mshub-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.mshub-content-card {
    position: relative;
}

.mshub-stat-icon, .mshub-platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  vertical-align: middle;
}
.mshub-stat-icon img, .mshub-platform-icon img, .mshub-stat-icon svg, .mshub-platform-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.mshub-chart-platform-filter button .checkmark {
  color: var(--mshub-primary);
  font-weight: bold;
  margin-right: 4px;
}

.mshub-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    width: 28px;
    height: 28px;
    color: var(--mshub-primary, #7B68EE);
    background: rgba(123,104,238,0.08);
    border-radius: 50%;
    margin-right: 6px;
}

.mshub-stat-icon.dashicons-controls-play { color: #7B68EE; background: rgb(28 28 28); }
.mshub-stat-icon.dashicons-heart { color: #e25555; background: rgba(226,85,85,0.12); }
.mshub-stat-icon.dashicons-download { color: #8134af; background: rgb(141 60 174 / 12%); }
.mshub-stat-icon.dashicons-groups { color: #00ff72; background: rgb(0 253 255 / 12%); }

/* Version: 1.2.4 */