/**
 * Projects Widget Styles
 *
 * Styles for the hierarchical taxonomy filtering projects widget
 * Includes parent tabs, child pills, and project grid layout
 *
 * @package iKnow
 * @since 1.0.0
 */

/* ===========================
   Font Family
   =========================== */

.iknow-projects-widget,
.iknow-projects-widget * {
  font-family: "Noto Sans", sans-serif;
}

/* ===========================
   Container & Layout
   =========================== */

.iknow-projects-widget {
  width: 100%;
}

.iknow-projects-filters-section,
.iknow-projects-grid-section {
  width: 100%;
  padding: 40px 0;
}

.iknow-projects-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===========================
   Section Title
   =========================== */

.iknow-projects-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 30px 0;
  color: #1a1a1a;
  line-height: 1.3;
}

/* ===========================
   Parent Category Tabs
   =========================== */

.iknow-projects-parent-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.iknow-parent-tab {
  flex: 1;
  min-width: 150px;

  padding: 24px 20px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  text-align: center;
}

.iknow-parent-tab:hover {
  border-color: #41ae75;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(65, 174, 117, 0.15);
}

.iknow-parent-tab.active {
  border-color: #41ae75;
  background: rgba(65, 174, 117, 0.08);
  box-shadow: 0 4px 12px rgba(65, 174, 117, 0.2);
}

.iknow-parent-tab-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #41ae75;
}

.iknow-parent-tab-icon svg {
  width: 100%;
  height: 100%;
}

.iknow-parent-tab-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
}

/* ===========================
   Child Category Pills
   =========================== */

.iknow-projects-child-pills-wrapper {
  margin-bottom: 32px;
  min-height: 40px;
}

.iknow-projects-child-pills {
  display: none;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.iknow-projects-child-pills--visible {
  display: flex;
}

.iknow-child-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.iknow-child-pill:hover {
  background: #e8f5ef;
  border-color: #41ae75;
}

.iknow-child-pill.active {
  background: #41ae75;
  border-color: #41ae75;
  color: #ffffff;
}

.iknow-child-pill.active svg circle {
  fill: #ffffff;
}

.iknow-child-pill svg {
  flex-shrink: 0;
}

/* ===========================
   Clear Filters Buttons
   =========================== */

.iknow-clear-parent-filters,
.iknow-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  margin-top: 8px;
}

.iknow-clear-parent-filters:hover,
.iknow-clear-filters:hover {
  background: #fff5f5;
  border-color: #ff5555;
  color: #ff5555;
}

.iknow-clear-parent-filters svg,
.iknow-clear-filters svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* ===========================
   Projects Grid
   =========================== */

.iknow-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.iknow-project-card {
  opacity: 1;
  transition: all 0.4s ease;
  transform: scale(1);
}

.iknow-project-card.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: absolute;
  left: -9999px;
}

.iknow-project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.iknow-project-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: #41ae75;
}

/* ===========================
   Project Image
   =========================== */

.iknow-project-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: #f5f5f5;
}

.iknow-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.iknow-project-card-link:hover .iknow-project-image img {
  transform: scale(1.05);
}

.iknow-project-no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===========================
   Project Content
   =========================== */

.iknow-project-content {
  padding: 24px;
}

.iknow-project-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #1a1a1a;
  line-height: 1.4;
}

.iknow-project-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===========================
   Project Categories
   =========================== */

.iknow-project-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.iknow-project-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  color: #42ae75;
  padding: 16px 8px;
  background: #f7f6f6;
  border-radius: 8px;

  transition: all 0.2s ease;
}

.iknow-project-category-tag:hover {
  background: rgba(66, 174, 117, 0.12);
  border-color: rgba(66, 174, 117, 0.3);
}

.iknow-project-category-tag svg {
  flex-shrink: 0;
}

.iknow-project-category-tag svg circle {
  fill: #42ae75;
}

/* ===========================
   No Results Message
   =========================== */

.iknow-projects-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}

.iknow-projects-no-results p {
  font-size: 18px;
  color: #999;
  margin: 0;
}

/* ===========================
   Responsive Design
   =========================== */

/* Tablet - Medium screens */
@media (max-width: 992px) {
  .iknow-projects-title {
    font-size: 28px;
    margin-bottom: 24px;
  }

  .iknow-projects-parent-tabs {
    gap: 12px;
  }

  .iknow-parent-tab {
    min-width: 160px;
    padding: 16px 20px;
  }

  .iknow-parent-tab-icon {
    width: 28px;
    height: 28px;
  }

  .iknow-parent-tab-title {
    font-size: 15px;
  }

  .iknow-projects-grid {
    gap: 24px;
  }

  .iknow-project-image {
    height: 240px;
  }

  .iknow-project-content {
    padding: 20px;
  }

  .iknow-project-title {
    font-size: 18px;
  }
}

/* Mobile - Small screens */
@media (max-width: 768px) {
  .iknow-projects-widget {
    padding: 30px 0;
  }

  .iknow-projects-container {
    padding: 0 16px;
  }

  .iknow-projects-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .iknow-projects-parent-tabs {
    flex-direction: column;
    gap: 10px;
  }

  .iknow-parent-tab {
    min-width: 100%;
    max-width: 100%;
    padding: 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .iknow-projects-child-pills {
    gap: 8px;
    margin-bottom: 12px;
  }

  .iknow-child-pill {
    padding: 6px 14px;
    font-size: 13px;
  }

  .iknow-clear-filters {
    padding: 6px 14px;
    font-size: 13px;
  }

  .iknow-projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .iknow-project-image {
    height: 200px;
  }

  .iknow-project-content {
    padding: 16px;
  }

  .iknow-project-title {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .iknow-project-excerpt {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .iknow-project-categories {
    gap: 6px;
    margin-top: 12px;
  }

  .iknow-project-category-tag {
    font-size: 11px;
  }
}

/* Extra small mobile */
@media (max-width: 480px) {
  .iknow-projects-title {
    font-size: 22px;
  }

  .iknow-parent-tab {
    padding: 18px 16px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .iknow-parent-tab-icon {
    width: 32px;
    height: 32px;
  }

  .iknow-parent-tab-title {
    font-size: 14px;
  }

  .iknow-project-image {
    height: 180px;
  }
}

/* ===========================
   Loading State
   =========================== */

.iknow-projects-grid.loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ===========================
   Animation & Transitions
   =========================== */

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

.iknow-project-card:not(.hidden) {
  animation: fadeIn 0.4s ease forwards;
}

/* Stagger animation for grid items */
.iknow-project-card:nth-child(1) {
  animation-delay: 0.05s;
}
.iknow-project-card:nth-child(2) {
  animation-delay: 0.1s;
}
.iknow-project-card:nth-child(3) {
  animation-delay: 0.15s;
}
.iknow-project-card:nth-child(4) {
  animation-delay: 0.2s;
}
.iknow-project-card:nth-child(5) {
  animation-delay: 0.25s;
}
.iknow-project-card:nth-child(6) {
  animation-delay: 0.3s;
}
