.category-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 12px;
  color: var(--primary-color);
}

.category-desc {
  text-align: center;
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--light-text);
}

.projects-wrapper {
  position: relative;
  margin: 0 24px;
}

.projects-container {
  display: flex;
  overflow-x: auto;
  gap: 24px;
  padding: 24px 12px;
  margin-bottom: 80px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  align-items: flex-start;
}

.projects-container::-webkit-scrollbar {
  height: 10px;
}

.projects-container::-webkit-scrollbar-track {
  margin: 150px;
  background: var(--light-gray);
  border-radius: 12px;
}

.projects-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg,var(--primary-color),var(--primary-dark));
  border-radius: 12px;
}

.card {
  position: relative;
  background: var(--card-background);
  border: var(--border-general);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-project-card);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 320px;
  max-width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--primary-color);
  border-color: var(--primary-color);
}

.card::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--brand-gradient);
  opacity: 0.08;
  filter: blur(45px);
  z-index: 0;
  transition: opacity 0.5s ease;
}

.card:hover::after {
  opacity: 0.15;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card.featured {
  border: 2px solid var(--primary-color);
  box-shadow: 0 15px 35px rgba(13, 148, 136, 0.2);
}

.featured-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  color: #fff;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.featured-badge.flutter {
  background: #0277bd; /* Flutter Blue */
}

.featured-badge.compose {
  background: #3d9970; /* Compose Green */
}

.featured-badge.xml {
  background: #e67e22; /* XML Orange */
}

@media (min-width: 992px) {
}

.project-image {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  height: 320px;
  background: #000;
  width: 100%;
}

.image-slider {
  width: 100%;
  height: 100%;
  position: relative;
  /* Default to 1 image per view (mobile) */
  --items-per-view: 1;
}

@media (min-width: 768px) {
  .image-slider {
    /* Show 3 images per view on desktop */
    --items-per-view: 3;
  }
}

.slider-container {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  gap: 0;
}

.slider-image {
  /* Each image takes a fraction of the visible width */
  flex: 0 0 calc(100% / var(--items-per-view));
  width: calc(100% / var(--items-per-view));
  height: 100%; /* Changed from 320px to 100% to fit container responsiveness */
  object-fit: contain;
  background: #000;
  display: block;
  transition: transform .25s ease, filter .25s ease;
}

.project-image:hover .slider-image {
  transform: scale(1.02);
  filter: brightness(.95);
}

.slider-nav {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 10;
  flex-wrap: wrap;
  padding: 0 10px;
}

.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  flex-shrink: 0;
}

.slider-dot.active {
  background: var(--primary-color);
  transform: scale(1.2);
  box-shadow: 0 0 10px var(--primary-color);
}

.slider-arrows {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0; /* Removing horizontal padding to allow buttons to reach edges */
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  pointer-events: none;
}

.slider-arrows button {
  pointer-events: auto;
  height: 100%; /* Make arrows span full height for maximum vertical touch space */
  width: 60px; /* Wider hit area */
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.slider-arrows button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.project-image:hover .slider-arrows {
  opacity: 1;
}

.slider-controls {
  position: absolute;
  bottom: 45px; /* Moved to bottom-right, above the dots */
  right: 15px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 20;
}

.project-image:hover .slider-controls {
  opacity: 1;
}

.project-content {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.project-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 100%;
  color: var(--light-text);
  text-align: left;
}

.project-title h3 {
  margin: 0;
  font-size: 1.4rem;
  color: inherit;
}

.toggle-arrow {
  display: inline-block;
  cursor: pointer;
  transition: transform .28s ease;
  color: var(--primary-color);
  font-size: 1.5rem;
  transform-origin: center;
}

.card.open .toggle-arrow {
  transform: rotate(180deg);
}

.details {
  max-height: 0;
  overflow: hidden;
  padding: 0 18px;
  background: var(--inner-details-background);
  border-radius: 16px;
  transition: max-height .36s ease, padding .28s ease;
}

.details-inner {
  padding: 14px 0;
  color: var(--dark-text);
  font-size: 14px;
  line-height: 1.6;
}

.project-features {
  margin: 8px 0 0 16px;
  padding: 0;
}

.project-features li {
  margin: 6px 0;
}

.project-tags {
  margin: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  background: var(--project-tags-background);
  border: var(--border-project-tags);
  color: var(--light-text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
}

.external-links {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 10px;
  z-index: 25;
}

.icon-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.icon-link:hover {
  transform: translateY(-3px) scale(1.1);
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
}

.icon-link.github:hover {
  background: #333;
  border-color: #444;
}

.icon-link.demo:hover {
  background: var(--primary-color);
}
