/* Stories Component Styles (Bornova) */
/* Not: Klavye odağı (focus) görünürlüğü global accessibility.css tarafından
   (kırmızı, !important) yönetilir; burada ayrı bir :focus-visible kuralı yok. */

.stories-container {
  width: 100%;
}

.loading {
  width: 100%;
  padding: 2rem 0;
  text-align: center;
  color: #666;
}

/* Story Circles */
.stories-list {
  display: flex;
  gap: 1.5rem;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  flex-wrap: wrap;
}

.story-circle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.story-circle:hover {
  transform: scale(1.1);
}

.story-image-wrapper {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e79aa0;
  padding: 0.25rem;
}

@media (min-width: 768px) {
  .story-image-wrapper {
    width: 6rem;
    height: 6rem;
  }
}

.story-image-container {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: white;
}

.story-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
  margin-top: 0.5rem;
  text-align: center;
  max-width: 5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .story-title {
    max-width: 6rem;
  }
}

/* Modal */
.story-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #02478e;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 32rem;
  margin: 0 auto;
  background: #02478e;
  border: none !important;
}

@media (min-width: 768px) {
  .modal-content {
    max-width: 50rem;
  }
}

/* Progress Bars */
.progress-container {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 20;
}

.progress-bars {
  display: flex;
  gap: 0.25rem;
}

.progress-bar {
  flex: 1;
  height: 0.25rem;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, white, #e5e7eb);
  border-radius: 9999px;
  transition: width 0.3s ease-out; /* JS gerektiğinde override edecek */
}

.progress-fill.no-transition {
  transition: none !important;
}

/* Modal Header */
.modal-header {
  position: absolute;
  top: 2.5rem;
  z-index: 20;
  display: flex;
  width: 100%;
  padding: 0 1.5rem;
  justify-content: space-between;
  align-items: center;
  border-bottom: none !important;
}

.story-modal-title {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.control-buttons {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  width: 2.6rem;
  height: 2.6rem;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}
.control-btn:focus,
.control-btn:hover {
  background: #bd1522;
}

.control-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

@media (min-width: 768px) {
  .control-btn svg {
    width: 1.5rem;
    height: 1.5rem;
  }
}

/* Play/Pause button states */
.control-btn .pause-icon {
  display: block;
}

.control-btn .play-icon {
  display: none;
  margin-left: 0.125rem;
}

/* Navigation Arrows */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-btn:focus,
.nav-btn:hover {
  background: #bd1522;
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.prev-btn {
  left: 1rem;
}

.next-btn {
  right: 1rem;
}

@media (min-width: 768px) {
  .prev-btn {
    left: -5rem;
  }

  .next-btn {
    right: -5rem;
  }
}

.nav-btn svg {
  width: 2rem;
  height: 2rem;
}

@media (min-width: 768px) {
  .nav-btn {
    width: 4rem;
    height: 4rem;
  }
}

/* Main Content */
.story-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.story-content.transitioning {
  transform: scale(0.8);
  opacity: 0.8;
}

.story-image-main {
  position: relative;
  width: 100%;
  max-width: 40rem;
}

.story-image-main img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  object-fit: cover;
}

.story-link {
  position: absolute;
  bottom: 2.5rem;
  left: 0;
  right: 0;
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1rem;
  text-align: center;
  z-index: 20;
  text-decoration: none;
  transition: all 0.2s ease-out;
}

.story-link:hover {
  text-decoration: underline;
}

.story-link:focus {
  text-decoration: underline;
}

.story-content.transitioning .story-link {
  opacity: 0.6;
  transform: translateY(0.25rem);
}

/* Click Areas */
.click-areas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  pointer-events: none;
}

.click-area {
  width: 50%;
  height: 100%;
  cursor: pointer;
  pointer-events: auto;
}

.click-area-left {
  left: 0;
}

.click-area-right {
  right: 0;
}

/* Responsive Design */
@media (max-width: 640px) {
  .stories-list {
    gap: 0.8rem;
    padding: 0.25rem 0.4rem;
  }

  .modal-header {
    padding: 0 1rem;
  }

  .story-modal-title {
    font-size: 1rem;
  }

  .story-link {
    font-size: 1.125rem;
    bottom: 2rem;
    padding: 0 1rem;
  }
}

@media (max-width: 420px) {
  .stories-list {
    gap: 0.5rem;
    padding: 0.25rem 0.2rem;
  }
  .story-image-wrapper {
    width: 4rem;
    height: 4rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .story-circle,
  .control-btn,
  .nav-btn,
  .story-content,
  .progress-fill {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .story-modal {
    background: #02478e;
  }

  .progress-bar {
    background: #666;
  }

  .progress-fill {
    background: white;
  }
}
