/* =========================================
   CONTAINER & LAYOUT
========================================= */
.datasets-widget-container,
.tools-widget-container,
.code-widget-container {
  font-family: Arial, sans-serif;
  color: #333;
  max-width: 100%;
  box-sizing: border-box;
}

/* =========================================
   FILTERS
========================================= */
.pub-filters-wrapper { 
  background-color: #f9f9f9; 
  border: 1px solid #dcdede; 
  border-radius: 8px; 
  padding: 20px; 
  margin-bottom: 40px; 
}

.pub-filter-row { 
  display: flex; 
  align-items: flex-start; 
  margin-bottom: 15px; 
}

.pub-filter-row:last-child { 
  margin-bottom: 0; 
}

.pub-filter-label { 
  font-weight: 700; 
  color: #1e2328; 
  width: 80px; 
  flex-shrink: 0; 
  margin-top: 8px; 
}

.pub-filter-container { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap; 
}

.pub-filter-pill {
  background-color: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 14px;
  color: #3c4043;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pub-filter-pill:hover { 
  background-color: #f1f3f4; 
}

.pub-filter-pill.active { 
  background-color: #002c5f; 
  color: #fff; 
  border-color: #002c5f; 
  font-weight: 500; 
}

/* =========================================
   GRID (3 Columns)
========================================= */
.dataset-grid-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 24px;
  margin-bottom: 40px;
  align-items: stretch; 
}

@media (max-width: 900px) {
  .dataset-grid-layout { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .dataset-grid-layout { grid-template-columns: 1fr; }
}

/* =========================================
   CARDS
========================================= */
.kaggle-card {
  display: flex !important;
  flex-direction: column !important; 
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  
  /* CRITICAL FIX: Changed from hidden to visible so tooltips aren't cut off */
  overflow: visible !important; 
  
  text-decoration: none !important;
  color: #202124;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  height: 100%; 
  position: relative; /* Helps anchor the tooltip correctly */
}

.kaggle-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  z-index: 10;
}

.k-card-img {
  width: 100%;
  height: 140px;
  flex-shrink: 0 !important; 
  background-color: #f1f3f4;
  border-bottom: 1px solid #dadce0;
  display: block !important;
    border-radius: 12px 12px 0 0; 
}

.k-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block !important;
  border-radius: 12px 12px 0 0; 
}

.k-card-body {
  padding: 16px;
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1; 
  box-sizing: border-box;
  min-width: 0; 
  word-wrap: break-word; 
}

/* Shared Breadcrumb Label */
.k-tool-type {
  font-size: 10px; 
  font-weight: 700; 
  color: #5f6368; 
  text-transform: uppercase; 
  margin-bottom: 4px; 
  display: block;
}

.k-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.4;
  color: #202124; 
}

.k-author {
  font-size: 14px;
  color: #5f6368;
  margin: 0 0 15px 0;
}

.clickable-author {
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: color 0.1s ease;
  text-decoration: underline; 
}

.clickable-author:hover {
  color: #1a0dab;
}

.k-meta-row {
  margin-top: auto; 
  font-size: 13px;
  color: #70757a;
  margin-bottom: 12px;
}

/* =========================================
   TAGS & PAGINATION
========================================= */
.team-card-tags { 
  display: flex; 
  gap: 6px; 
  flex-wrap: wrap; 
}

.tag-pill { 
  font-size: 9px; 
  font-weight: 700; 
  padding: 3px 6px; 
  border-radius: 2px; 
  color: #ffffff; 
  text-transform: uppercase; 
  white-space: nowrap; 
}

.dataset-pagination-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

/* Domain Colors */
.tag-black  { background-color: #2D3748 !important; } 
.tag-blue   { background-color: #2B6CB0 !important; } 
.tag-purple { background-color: #6B46C1 !important; } 
.tag-green  { background-color: #2F855A !important; } 
.tag-red    { background-color: #C53030 !important; } 
.tag-teal   { background-color: #2C7A7B !important; }
.tag-orange { background-color: #DD6B20 !important; }
.tag-yellow { background-color: #D69E2E !important; }
.tag-cyan   { background-color: #00B5D8 !important; }
.tag-gray   { background-color: #718096 !important; }

/* =========================================
   HOVER TOOLTIP (Fixed clipping and font)
========================================= */
.k-tooltip-wrapper {
  position: relative;
  display: inline-block;
  cursor: help; 
}

.k-more-text {
  color: #1a0dab;
  font-weight: 600;
  margin-left: 2px;
  text-decoration: underline dotted; 
}

.k-more-text:hover {
  color: #d93025; 
}

.k-tooltip-content {
  visibility: hidden;
  text-align: center;
  position: absolute; 
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: Arial, sans-serif !important;
  font-size: 12px !important; 
  font-weight: 500;
  
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  max-width: 300px;
  background-color: #ffffff;
  color: #222;
  border: 1px solid #dadce0;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.4;
  box-shadow: 0px 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
  z-index: 9999;
}

.k-tooltip-content::after,
.k-tooltip-content::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border-style: solid;
}

.k-tooltip-content::after {
  margin-left: -5px;
  border-width: 5px;
  border-color: #ffffff transparent transparent transparent;
}

.k-tooltip-content::before {
  margin-left: -6px;
  border-width: 6px;
  border-color: #dadce0 transparent transparent transparent;
}

.k-tooltip-wrapper:hover .k-tooltip-content {
  visibility: visible;
  opacity: 1;
}