/* Korners Tiles Section Styles */
.korners-tiles-section {
  background: var(--color-purple, #8B5A96);
  padding: 60px 0;
  position: relative;
  overflow: visible;
}

.korners-tiles-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  text-align: center;
  color: var(--color-white, #ffffff);
  font-size: var(--font-size-3xl, 2rem);
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-lg, 1.125rem);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Corner decorations for the section */
.korners-tiles-section::before,
.korners-tiles-section::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-teal, #20B2AA);
  z-index: 10;
}

.korners-tiles-section::before {
  top: 20px;
  left: 20px;
  border-right: none;
  border-bottom: none;
}

.korners-tiles-section::after {
  top: 20px;
  right: 20px;
  border-left: none;
  border-bottom: none;
}

/* Carousel wrapper */
.korners-carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: visible;
  z-index: 1;
}

/* Horizontal carousel container */
.korners-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  overflow: visible;
  z-index: 2;
}

.korners-viewport {
  overflow: hidden;
  width: 100%;
  position: relative;
  padding: 20px 0;
  z-index: 1;
}

.korners-track {
  display: flex;
  gap: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  align-items: flex-start;
  will-change: transform;
}

/* Individual korner tiles - horizontal layout */
.korner-slide {
  flex: 0 0 auto;
  width: 200px;
  min-width: 200px;
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.korner-slide:hover {
  transform: translateY(-8px);
  z-index: 2;
}

.korner-tile-image {
  width: 200px;
  height: 200px;
  min-width: 200px;
  min-height: 200px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease;
  display: block;
  background: transparent;
  z-index: 1;
}

.korner-slide:hover .korner-tile-image {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.korner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  display: block;
  background: transparent;
  opacity: 1;
  visibility: visible;
  z-index: 1;
  max-width: none;
  max-height: none;
}

.korner-tile-name {
  margin-top: 12px;
  color: var(--color-white, #ffffff);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  word-wrap: break-word;
  padding: 0 8px;
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* Corner decorations for individual tiles */
.korner-tile-image::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-white, #ffffff);
  border-left: none;
  border-bottom: none;
  z-index: 5;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.korner-slide:hover .korner-tile-image::before {
  opacity: 1;
  border-color: var(--color-teal, #20B2AA);
}

/* Additional corner decoration on opposite corner */
.korner-tile-image::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-white, #ffffff);
  border-right: none;
  border-top: none;
  z-index: 5;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.korner-slide:hover .korner-tile-image::after {
  opacity: 1;
  border-color: var(--color-teal, #20B2AA);
}

/* Navigation buttons */
.korners-nav {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--color-white, #ffffff);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
  opacity: 1;
  visibility: visible;
}

.korners-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-teal, #20B2AA);
  transform: scale(1.05);
}

.korners-nav:focus {
  outline: 2px solid var(--color-teal, #20B2AA);
  outline-offset: 2px;
}

.korners-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.korners-nav svg {
  width: 20px;
  height: 20px;
}

/* Loading state */
.korner-slide.loading {
  opacity: 0.7;
}

.korner-slide.loading .korner-tile-image {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  animation: pulse 1.5s ease-in-out infinite;
}

.korner-slide.loading .korner-tile-image::before {
  content: 'Loading...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  border: none;
  width: auto;
  height: auto;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .korners-carousel {
    gap: 12px;
  }
  
  .korners-track {
    gap: 16px;
  }
  
  .korner-slide {
    width: 180px;
    min-width: 180px;
  }
  
  .korner-tile-image {
    width: 180px;
    height: 180px;
    min-width: 180px;
    min-height: 180px;
  }
  
  .korners-nav {
    width: 44px;
    height: 44px;
  }
  
  .korners-nav svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 768px) {
  .korners-tiles-section {
    padding: 40px 0;
  }
  
  .korners-tiles-section .container {
    padding: 0 16px;
  }
  
  .section-title {
    font-size: var(--font-size-2xl, 1.5rem);
  }
  
  .section-subtitle {
    font-size: var(--font-size-base, 1rem);
    margin-bottom: 2rem;
  }
  
  .korners-carousel {
    gap: 8px;
  }
  
  .korners-track {
    gap: 12px;
  }
  
  .korner-slide {
    width: 160px;
    min-width: 160px;
  }
  
  .korner-tile-image {
    width: 160px;
    height: 160px;
    min-width: 160px;
    min-height: 160px;
    border-radius: 10px;
  }
  
  .korner-tile-name {
    font-size: 13px;
    margin-top: 10px;
  }
  
  .korners-nav {
    width: 40px;
    height: 40px;
  }
  
  .korners-nav svg {
    width: 16px;
    height: 16px;
  }
  
  /* Adjust corner decorations for smaller screens */
  .korners-tiles-section::before,
  .korners-tiles-section::after {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }
  
  .korners-tiles-section::before {
    top: 16px;
    left: 16px;
  }
  
  .korners-tiles-section::after {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .korners-tiles-section {
    padding: 30px 0;
  }
  
  .korners-tiles-section .container {
    padding: 0 12px;
  }
  
  .section-title {
    font-size: var(--font-size-xl, 1.25rem);
  }
  
  .section-subtitle {
    font-size: var(--font-size-sm, 0.875rem);
    margin-bottom: 1.5rem;
  }
  
  .korners-carousel {
    gap: 6px;
  }
  
  .korners-track {
    gap: 10px;
  }
  
  .korner-slide {
    width: 140px;
    min-width: 140px;
  }
  
  .korner-tile-image {
    width: 140px;
    height: 140px;
    min-width: 140px;
    min-height: 140px;
    border-radius: 8px;
  }
  
  .korner-tile-name {
    font-size: 12px;
    margin-top: 8px;
  }
  
  .korners-nav {
    width: 36px;
    height: 36px;
  }
  
  .korners-nav svg {
    width: 14px;
    height: 14px;
  }
  
  /* Smaller corner decorations */
  .korner-tile-image::before,
  .korner-tile-image::after {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
  }
  
  .korner-tile-image::before {
    top: 6px;
    right: 6px;
  }
  
  .korner-tile-image::after {
    bottom: 6px;
    left: 6px;
  }
  
  .korners-tiles-section::before,
  .korners-tiles-section::after {
    width: 12px;
    height: 12px;
    border-width: 2px;
  }
  
  .korners-tiles-section::before {
    top: 12px;
    left: 12px;
  }
  
  .korners-tiles-section::after {
    top: 12px;
    right: 12px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .korners-nav {
    border-width: 3px;
    border-color: var(--color-white, #ffffff);
  }
  
  .korner-tile-image::before,
  .korner-tile-image::after {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .korners-track {
    transition: none;
  }
  
  .korner-slide {
    transition: none;
  }
  
  .korner-tile-image {
    transition: none;
  }
  
  .korners-nav {
    transition: none;
  }
  
  .korner-slide.loading .korner-tile-image {
    animation: none;
  }
}

/* Focus visible support */
.korner-slide:focus-visible {
  outline: 2px solid var(--color-teal, #20B2AA);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Print styles */
@media print {
  .korners-tiles-section {
    background: none !important;
    color: black !important;
  }
  
  .korners-nav {
    display: none;
  }
  
  .korners-track {
    display: block;
  }
  
  .korner-slide {
    display: inline-block;
    width: auto;
    margin: 10px;
    page-break-inside: avoid;
  }
}

/* Accessibility */
.korner-slide:focus-within {
  outline: 3px solid var(--color-teal, #20B2AA);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Ensure corner decorations are always visible */
.korners-viewport {
  padding: 20px 4px;
}

.korners-track {
  overflow: visible;
}

/* Error state for failed image loads */
.korner-slide img[src*="placehold.co"] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

/* Smooth transitions for all interactive elements */
.korner-slide,
.korner-tile-image,
.korners-nav {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure corner decorations are always visible */
.korners-viewport {
  padding: 20px 4px;
}

.korners-track {
  overflow: visible;
}

/* Loading state */
.korner-slide.loading {
  opacity: 0.7;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Error state for failed image loads */
.korner-slide img[src*="placehold.co"] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

/* Smooth transitions for all interactive elements */
.korner-slide,
.korner-tile-image,
.korners-nav {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .korners-nav {
    border-width: 3px;
    background: rgba(0, 0, 0, 0.8);
  }
  
  .korner-tile-image::before,
  .korner-tile-image::after {
    border-width: 3px;
    opacity: 1;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .korner-slide,
  .korner-tile-image,
  .korners-nav,
  .korners-track {
    transition: none;
  }
  
  .korner-slide:hover {
    transform: none;
  }
  
  .korners-nav:hover:not(:disabled) {
    transform: none;
  }
}

/* Print styles */
@media print {
  .korners-nav {
    display: none;
  }
  
  .korners-track {
    transform: none !important;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
  }
  
  .korner-slide {
    width: auto;
    min-width: auto;
  }
}
