/* public/modules/statistics-styles.css */
/* Statistikos modulio stiliai */

.statistics-container {
  padding: 0;
  margin: 0;
}

.stats-section {
  margin-bottom: 25px;
}

.stats-section:last-child {
  margin-bottom: 0;
}

.stats-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== GRID LAYOUT ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

/* ===== NAUJAUSI ĮRAŠAI KAIP JUODI TAG'AI (DARK MODE) ===== */
.recent-listings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.recent-listing-tag {
  background: rgba(0, 0, 0, 0.1);
  color: #000000;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.2);
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.3;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.recent-listing-tag:hover {
  background: rgba(0, 0, 0, 0.2);
  border-color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.recent-listing-tag:active {
  transform: translateY(0);
}

/* ===== STATS CARDS (DARK MODE) ===== */
.stats-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
}

.stats-card:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-card-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.stats-card-content {
  flex: 1;
  min-width: 0;
}

.stats-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stats-card-count {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Paspaudžiamos miestų kortelės */
.clickable-city-card {
  position: relative;
  cursor: pointer;
}

.clickable-city-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.stats-card-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #666;
  font-size: 14px;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.clickable-city-card:hover .stats-card-arrow {
  color: #000000;
  transform: translateY(-50%) translateX(2px);
  opacity: 1;
}

/* ===== RECENT LISTINGS ===== */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-listing-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stats-listing-card:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-listing-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.stats-listing-content {
  flex: 1;
  min-width: 0;
}

.stats-listing-title {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stats-listing-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-listing-city,
.stats-listing-date {
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
}

.stats-listing-arrow {
  font-size: 16px;
  color: #666;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.stats-listing-card:hover .stats-listing-arrow {
  transform: translateX(2px);
  color: #000000;
}

/* ===== LOADING & ERROR STATES ===== */
.stats-loading,
.stats-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
}

.stats-error {
  text-align: center;
  padding: 40px 20px;
}

.stats-error-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.stats-error-text {
  color: #666;
  font-size: 14px;
  margin-bottom: 16px;
}

.stats-retry-btn {
  background: #000000;
  color: #FFC700;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stats-retry-btn:hover {
  background: #333333;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-sidebar-tabs {
    top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(220, 220, 220, 0.6);
  }

  .main-tab {
    width: 50px;
    height: 50px;
    gap: 2px;
  }

  .main-tab-icon {
    font-size: 16px;
  }

  .main-tab-text {
    font-size: 8px;
  }

  .main-tab:hover,
  .main-tab.active {
    transform: translateY(-2px);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-card {
    min-height: 60px;
    padding: 12px;
  }
  
  .stats-listing-card {
    padding: 12px;
  }
  
  .stats-listing-meta {
    flex-direction: row;
    gap: 8px;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.statistics-container {
  contain: layout style paint;
  will-change: transform;
}

.stats-card,
.stats-listing-card {
  contain: layout style;
  transform: translateZ(0); /* Force GPU acceleration */
}

/* ===== HIDE EXTERNAL TABS (NOT NEEDED) ===== */
.main-sidebar-tabs {
  display: none;
}

/* ===== SIDEBAR TAB INTEGRATION (RESTORED ORIGINAL) ===== */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid rgba(220, 220, 220, 0.6);
  margin-bottom: 15px;
  background: rgba(248, 249, 250, 0.8);
  border-radius: 8px 8px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-tab {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  background: none;
  border: none;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sidebar-tab:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #000000;
}

.sidebar-tab.active {
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  border-bottom: 2px solid #000000;
}

.sidebar-tab-icon {
  font-size: 14px;
}

.sidebar-tab-text {
  font-size: 11px;
}

/* ===== SIDEBAR VIEW STATES ===== */
.sidebar-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* ===== COMPACT MODE (for smaller sidebars) ===== */
.sidebar-compact .stats-grid {
  grid-template-columns: 1fr;
}

.sidebar-compact .stats-card {
  min-height: 45px;
  padding: 8px;
}

.sidebar-compact .stats-card-title {
  font-size: 12px;
}

.sidebar-compact .stats-card-count {
  font-size: 10px;
}

.sidebar-compact .stats-listing-card {
  padding: 8px;
}

.sidebar-compact .stats-listing-title {
  font-size: 12px;
}

.sidebar-compact .stats-listing-city,
.sidebar-compact .stats-listing-date {
  font-size: 10px;
}

/* ===== SKELETON LOADING ===== */
.skeleton {
  pointer-events: none;
  cursor: default !important;
}

.skeleton-icon,
.skeleton-text,
.skeleton-text-small {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.skeleton-text {
  height: 14px;
  width: 80%;
  margin-bottom: 4px;
}

.skeleton-text-small {
  height: 11px;
  width: 60%;
}

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

/* ===== INTERSECTION OBSERVER OPTIMIZATIONS ===== */
.stats-card[data-visible="false"],
.stats-listing-card[data-visible="false"] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.stats-card[data-visible="true"],
.stats-listing-card[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ULTRA COMPACT HIERARCHY ===== */
.stats-markdown {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #000000;
  padding: 16px;
  font-size: 16px;
  line-height: 1.5;
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filters {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.filters select {
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  cursor: pointer;
  flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: all 0.2s ease;
}

.filters select:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.4);
}

.filters select:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.city-section {
  margin-bottom: 16px;
  border-left: 3px solid #000000;
  padding-left: 12px;
}

.city-section.collapsed .city-body {
  display: none;
}

.city-section.collapsed .fold-icon {
  transform: rotate(-90deg);
}

.city-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: all 0.2s ease;
}

.city-title:hover {
  color: #333333;
}

.fold-icon {
  font-size: 12px;
  color: #000000;
  transition: transform 0.2s;
  display: inline-block;
  width: 14px;
  font-weight: 700;
}

.count {
  font-size: 16px;
  color: #333333;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.category-section {
  margin-bottom: 12px;
  margin-left: 8px;
}

.category-section.collapsed .category-body {
  display: none;
}

.category-section.collapsed .fold-icon {
  transform: rotate(-90deg);
}

.category-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: all 0.2s ease;
}

.category-title:hover {
  color: #333333;
}

.category-body {
  margin-left: 8px;
}

.subcategory-section {
  margin-bottom: 10px;
  margin-left: 8px;
}

.subcategory-section.collapsed .item-list {
  display: none;
}

.subcategory-section.collapsed .fold-icon {
  transform: rotate(-90deg);
}

.subcategory-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #333333;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: all 0.2s ease;
}

.subcategory-title:hover {
  color: #000000;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: 12px;
}

.item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 4px;
}

.item:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item-name {
  color: #000000;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.item-meta {
  font-size: 12px;
  color: #333333;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.item-more {
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  color: #000000;
  font-weight: 600;
  margin-top: 4px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.item-more:hover {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(0, 0, 0, 0.3);
}

.no-data {
  padding: 24px;
  text-align: center;
  color: #333333;
  font-size: 16px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== HOVER CARD ===== */
#hover-card {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  display: none;
  max-width: 320px;
  font-size: 14px;
  backdrop-filter: blur(8px);
}

.hover-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hover-title {
  font-weight: 700;
  color: #000000;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.hover-description {
  color: #000000;
  font-size: 14px;
  line-height: 1.4;
  margin: 6px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.hover-address {
  color: #000000;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* ===== MAIN CONTENT (COMPACT TRANSPARENT) ===== */
.main-content {
  padding: 16px;
}

.entries-section {
  margin-bottom: 20px;
}

.entries-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.entries-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.entry-item {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex; /* ✅ PAKEISTA: flex-direction row */
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: fit-content;
}

.entry-item:hover {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.entry-emoji {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.entry-title {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}


.more-button {
  padding: 12px 16px;
  background: #000000;
  color: #FFC700;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  transition: all 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.more-button:hover {
  background: #333333;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.back-button {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.1);
  color: #000000;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  transition: all 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.back-button:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .stats-card,
  .stats-listing-card,
  .sidebar-tab,
  .skeleton-icon,
  .skeleton-text,
  .skeleton-text-small {
    animation: none !important;
    transition: none !important;
  }
  
  .stats-card:hover,
  .stats-listing-card:hover,
  .recent-listing-tag:hover {
    transform: none !important;
  }
}

/* ===== ADDITIONAL RESPONSIVE FOR RECENT LISTINGS ===== */
@media (max-width: 480px) {
  .recent-listing-tag {
    font-size: 12px;
    padding: 6px 12px;
    max-width: 140px;
  }
}
