/* ============================================
   BK-POPUP MODULE - VANILLA CSS
   Standalone, reusable popup/modal component
   Matches iletisim.html popup design exactly
   ============================================ */

/* Popup Container */
.bk-popup {
  position: fixed;
  inset: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  border: 0;
  background: transparent;
  z-index: 9999;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bk-popup.is--open {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Background Overlay */
.bk-popup-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: pointer;
  border: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Content Wrapper */
.bk-popup-content-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  max-width: 768px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Close Button - Matches iletisim.html exactly (border removed) */
/* Buton inner container'ın üst kenarına göre konumlandırılmış */
.bk-popup-close {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 3;
  display: flex;
  transform: translateX(-50%) translateY(-50%);
  cursor: pointer;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  width: clamp(36px, 19.343px + 2.1661vw, 54px);
  height: clamp(36px, 19.343px + 2.1661vw, 54px);
  padding: 0;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
}

.bk-popup-close:hover {
  background: #5c595b;
}

.bk-popup-close-icon {
  position: relative;
  width: clamp(36px, 19.343px + 2.1661vw, 54px);
  height: clamp(36px, 19.343px + 2.1661vw, 54px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.bk-popup-close:hover .bk-popup-close-icon {
  transform: rotate(90deg);
}

.bk-popup-close-line {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 1px;
  transform: translateX(-50%) translateY(-50%);
  background: #000;
  width: clamp(14px, 10.2984px + 0.4813vw, 18px);
}

.bk-popup-close-line:first-child {
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
}

.bk-popup-close-line:last-child {
  transform: translateX(-50%) translateY(-50%) rotate(-45deg);
}

.bk-popup-close:hover .bk-popup-close-line {
  background: #ffffff;
}

/* Inner Content Container - Matches shadow-popup */
.bk-popup-inner {
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-height: 65vh;
  border-radius: 16px;
  background: #ffffff;
  padding: clamp(32px, -21.6727px + 6.9795vw, 90px);
  display: flex;
  flex-direction: column;
}

/* Scroll Wrapper - Matches overflow-wrapper */
.bk-popup-scroll-wrapper {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 32px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Custom Scrollbar - Matches scrollbar-thin scrollbar-w-0.5 exactly */
.bk-popup-scroll-wrapper {
  /* CSS Variables for scrollbar customization */
  --scrollbar-track: rgba(250, 194, 90, 0.5);
  --scrollbar-thumb: #5c595b;
  --scrollbar-track-radius: 9999px;
  --scrollbar-thumb-radius: 9999px;
  --scrollbar-width: 0.1875rem; /* 3px */
  --scrollbar-height: 0.1875rem; /* 3px */
}

.bk-popup-scroll-wrapper::-webkit-scrollbar {
  display: block;
  width: var(--scrollbar-width, 0.1875rem);
  height: var(--scrollbar-height, 0.1875rem);
}

.bk-popup-scroll-wrapper::-webkit-scrollbar-track {
  background-color: var(--scrollbar-track);
  border-radius: var(--scrollbar-track-radius);
}

.bk-popup-scroll-wrapper::-webkit-scrollbar-track:hover {
  background-color: var(--scrollbar-track-hover, var(--scrollbar-track));
}

.bk-popup-scroll-wrapper::-webkit-scrollbar-track:active {
  background-color: var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)));
}

.bk-popup-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: var(--scrollbar-thumb-radius);
}

.bk-popup-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover, var(--scrollbar-thumb));
}

.bk-popup-scroll-wrapper::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)));
}

.bk-popup-scroll-wrapper::-webkit-scrollbar-corner {
  background-color: var(--scrollbar-corner, transparent);
  border-radius: var(--scrollbar-corner-radius, 0);
}

/* Firefox Scrollbar */
@supports (-moz-appearance: none) {
  .bk-popup-scroll-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb, #012169) var(--scrollbar-track, rgba(250, 194, 90, 0.5));
  }
}

/* Content Area - Matches data-editor-type styling */
.bk-popup-content {
  width: 100%;
  color: #000000;
  font-family: inherit;
  font-size: 1em;
  line-height: 1.6;
}

.bk-popup-content p {
  margin: 0 0 1em 0;
  font-size: inherit;
  line-height: inherit;
}

.bk-popup-content strong {
  font-weight: 600;
}

.bk-popup-content ul,
.bk-popup-content ol {
  margin: 1em 0;
  padding-left: 2em;
}

.bk-popup-content li {
  margin: 0.5em 0;
}

.bk-popup-content a {
  color: #012169;
  text-decoration: underline;
}

.bk-popup-content a:hover {
  color: #00154d;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .bk-popup-inner {
    padding: clamp(24px, 16px + 2vw, 40px);
    max-height: 60vh;
  }

  .bk-popup-scroll-wrapper {
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  .bk-popup-inner {
    max-height: 60vh;
  }
}

/* Prevent body scroll when popup is open */
body.bk-popup-open {
  overflow: hidden;
}

/* Animation for popup appearance */
@keyframes bk-popup-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.bk-popup.is--open {
  animation: bk-popup-fade-in 0.3s ease;
}

/* Accessibility - Focus outline removed as per user request */
.bk-popup-close:focus {
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bk-popup-background {
    background: rgba(0, 0, 0, 0.5);
  }

  .bk-popup-close {
    border-width: 2px;
  }
}

