/**
 * CogSec Dashboard Styles
 * Shared by all dashboard language versions
 */

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#dashboard-app {
  margin: 2rem 0;
}

.stats-overview {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}

.stats-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stats-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card {
  background: rgba(25, 25, 35, 0.85);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 8px;
  padding: 1rem 0.5rem;
  text-align: center;
  min-width: 0;
}

.stat-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: bold;
  color: #6c5ce7;
  white-space: nowrap;
}

.stat-label {
  color: #888;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Section headings inside dashboard */
#dashboard-app h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ccc;
  border-bottom: 1px solid rgba(108, 92, 231, 0.2);
  padding-bottom: 0.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0;
}

#dashboard-app h2:first-child {
  margin-top: 0;
}

/* Category distribution - horizontal rows */
.category-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 2rem 0;
}

.category-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(25, 25, 35, 0.85);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.category-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #888;
  min-width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-items {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  flex: 1;
  justify-content: flex-end;
}

.bar-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(108, 92, 231, 0.1);
  cursor: default;
  transition: all 0.2s;
  min-width: 70px;
}

.bar-item:hover {
  background: rgba(108, 92, 231, 0.25);
}

.bar-emoji {
  font-size: 1.1rem;
}

.bar-count {
  font-size: 0.8rem;
  color: #6c5ce7;
  font-weight: 600;
  min-width: 1.5rem;
}

/* Tooltips */
.bar-item .tooltip,
.reaction-item .tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(108, 92, 231, 0.5);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #e0e0e0;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 100;
  pointer-events: none;
  margin-bottom: 0.5rem;
}

.bar-item:hover .tooltip,
.reaction-item:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* Articles section with collapsible toggle */
.articles-section {
  margin: 2rem 0;
}

.articles-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #e0e0e0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.articles-toggle:hover {
  background: rgba(108, 92, 231, 0.2);
  border-color: rgba(108, 92, 231, 0.5);
}

.toggle-icon {
  color: #6c5ce7;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.toggle-text {
  font-weight: 500;
}

.toggle-count {
  color: #888;
  font-size: 0.8rem;
}

/* Articles list */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.article-item {
  background: rgba(25, 25, 35, 0.85);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 8px;
  padding: 1rem;
}

.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-title {
  color: #6c5ce7;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  flex: 1;
  min-width: 200px;
}

.article-title:hover {
  text-decoration: underline;
}

.article-total {
  color: #6c5ce7;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

.article-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
}

.reaction-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.group-label {
  color: #888;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reaction-item {
  position: relative;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: default;
}

.reaction-item.has-votes {
  background: rgba(108, 92, 231, 0.15);
  color: #e0e0e0;
}

.reaction-item.zero-votes {
  background: rgba(60, 60, 70, 0.3);
  color: #666;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .stats-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stats-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-value {
    font-size: 1.4rem;
  }
  
  .stat-label {
    font-size: 0.65rem;
  }
  
  .stat-icon {
    font-size: 1rem;
  }
  
  .category-items {
    flex-wrap: wrap;
  }
  
  .bar-item {
    min-width: 60px;
  }
  
  .article-item {
    padding: 0.75rem;
  }
  
  .article-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 0.5rem;
  }
  
  .article-title {
    min-width: unset;
    font-size: 0.9rem;
  }
  
  .article-reactions {
    gap: 0.5rem;
    justify-content: center;
  }
  
  .reaction-group {
    gap: 0.3rem;
  }
  
  .group-label {
    font-size: 0.65rem;
  }
  
  .reaction-item {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
  }
}

@media (max-width: 600px) {
  .category-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .category-title {
    min-width: unset;
  }
  
  .category-items {
    width: 100%;
    justify-content: space-around;
    flex-wrap: wrap;
  }
  
  .bar-item {
    min-width: 55px;
  }
}
