/* Tags Page Styles */
.tags-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  direction: rtl;
}

.tags-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--green-200);
}

.tags-title {
  color: var(--green-700);
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.tags-description {
  color: var(--green-600);
  font-size: 1.2rem;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.tags-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-100);
  padding: 12px 24px;
  border-radius: 25px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tags-count-number {
  color: var(--green-800);
  font-size: 1.5rem;
  font-weight: 700;
}

.tags-count-label {
  color: var(--green-700);
  font-size: 1rem;
  font-weight: 500;
}

.tags-container {
  margin-top: 40px;
}

.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 0;
}

.tag-card {
  background: #ffffff;
  border: 2px solid var(--green-200);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  width: 100%;
}

.tag-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-color: var(--green-300);
}

.tag-card:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tag-card:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: right;
}

.tag-card:hover:before {
  transform: scaleX(1);
  transform-origin: left;
}

.tag-card-content {
  padding: 16px;
}

.tag-name {
  color: var(--green-700);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.3;
  word-break: break-word;
}

.tag-description {
  color: var(--green-600);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
  opacity: 0.9;
}

.no-tags-message {
  text-align: center;
  padding: 64px 20px;
  background: var(--green-50);
  border-radius: 16px;
  border: 2px dashed var(--green-200);
}

.no-tags-message p {
  color: var(--green-600);
  font-size: 1.2rem;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tags-page {
    padding: 24px 16px;
  }
  
  .tags-title {
    font-size: 2.2rem;
  }
  
  .tags-description {
    font-size: 1rem;
  }
  
  .tags-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  
  .tag-card-content {
    padding: 14px;
  }
  
  .tag-name {
    font-size: 1rem;
  }
  
  .tag-description {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .tags-title {
    font-size: 1.8rem;
  }
  
  .tags-count {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
  
  .tags-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  
  .tag-card-content {
    padding: 12px;
  }
  
  .tag-name {
    font-size: 0.95rem;
  }
  
  .tag-description {
    font-size: 0.8rem;
  }
}

/* Animation for cards appearing */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tag-card {
  animation: fadeInUp 0.5s ease forwards;
}

.tag-card:nth-child(even) {
  animation-delay: 0.1s;
}

.tag-card:nth-child(3n) {
  animation-delay: 0.2s;
}

/* Focus styles for accessibility */
.tag-card:focus-within {
  outline: 2px solid var(--green-400);
  outline-offset: 2px;
}