@import 'family-chart/styles/family-chart.css';

fikoyt-soyagaci-genel {
  display: block;
  width: 100%;
  height: 100%;
}

/* =============================================== */
/*  SIFRE GIRIS EKRANI                             */
/* =============================================== */
.sifre-ekran {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  z-index: 999;
  overflow: hidden;
}

.sifre-arkaplan {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sifre-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: sifre-orb-hareket 20s ease-in-out infinite;
}

.sifre-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #3b82f6, transparent);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.sifre-orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #10b981, transparent);
  bottom: -80px;
  right: -80px;
  animation-delay: -7s;
}

.sifre-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #8b5cf6, transparent);
  top: 40%;
  left: 60%;
  animation-delay: -14s;
}

@keyframes sifre-orb-hareket {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.1); }
  50% { transform: translate(-20px, 30px) scale(0.9); }
  75% { transform: translate(20px, 20px) scale(1.05); }
}

.sifre-kart {
  position: relative;
  z-index: 1;
  width: 440px;
  max-width: 92vw;
  padding: 56px 44px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(32px);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  text-align: center;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(59, 130, 246, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: sifre-kart-giris 0.6s ease-out;
}

@keyframes sifre-kart-giris {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.sifre-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  animation: sifre-logo-pulse 3s ease-in-out infinite;

  svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.3));
  }
}

@keyframes sifre-logo-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.sifre-baslik {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.sifre-aciklama {
  font-size: 15px;
  color: #cbd5e1;
  margin: 0 0 32px;
  line-height: 1.6;
}

.sifre-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Sifre input - koyu tema (yuksek specificity) */
.sifre-ekran .sifre-kart .sifre-form {
  .ant-input-group-wrapper,
  .ant-input-wrapper,
  nz-input-group {
    border-radius: 12px !important;
  }

  .ant-input-affix-wrapper,
  .ant-input-affix-wrapper-lg {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 2px solid rgba(148, 163, 184, 0.3) !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    transition: all 0.3s ease !important;

    &:hover {
      border-color: rgba(59, 130, 246, 0.5) !important;
      background: rgba(15, 23, 42, 0.9) !important;
    }

    &:focus-within,
    &.ant-input-affix-wrapper-focused {
      border-color: #3b82f6 !important;
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 0 20px rgba(59, 130, 246, 0.1) !important;
      background: rgba(15, 23, 42, 0.9) !important;
    }
  }

  input.ant-input,
  .ant-input {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    letter-spacing: 1px;
    caret-color: #60a5fa;

    &::placeholder {
      color: #64748b !important;
      font-weight: 400 !important;
      letter-spacing: 0;
    }

    &:focus {
      box-shadow: none !important;
    }
  }

  .ant-input-prefix {
    color: #94a3b8 !important;
    font-size: 18px !important;
    margin-right: 10px !important;
  }
}

.sifre-hata {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #fecaca;
  font-size: 14px;
  font-weight: 500;
  animation: sifre-hata-shake 0.4s ease;

  .anticon {
    color: #f87171;
    font-size: 16px;
  }
}

@keyframes sifre-hata-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.sifre-giris-btn {
  margin-top: 8px;
  height: 48px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  transition: all 0.2s ease;

  &:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
  }

  &:active {
    transform: translateY(0);
  }
}

/* =============================================== */
/*  SOY AGACI TAM EKRAN                            */
/* =============================================== */
.genel-agac-sayfa {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* Toolbar */
.genel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.genel-toolbar-sol,
.genel-toolbar-sag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.genel-toolbar-orta {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.genel-toolbar-sag {
  gap: 6px;
}

/* Aktif Kisi Bilgisi */
.aktif-kisi-bilgi {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 20px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe, #a3c9f8);
  background-size: 200% 200%;
  position: relative;
  // animation: aktif-kisi-giris 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
  //            animated-background 15s ease infinite alternate;
  // border: 1px solid #bfdbfe;
  // max-width: 220px;
  // animation: aktif-kisi-giris 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);

  .aktif-kisi-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #93c5fd;
    flex-shrink: 0;
    // animation: aktif-kisi-avatar-giris 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .aktif-kisi-avatar-fb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    flex-shrink: 0;
    // animation: aktif-kisi-avatar-giris 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .aktif-kisi-ad {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    // animation: aktif-kisi-ad-giris 0.8s ease;
    position: relative; /* Eklendi */
  }
}

@keyframes aktif-kisi-giris {
  0% { opacity: 0; transform: translateX(16px) scale(0.92); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes aktif-kisi-avatar-giris {
  0% { transform: scale(0.6) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes aktif-kisi-ad-giris {
  0% { opacity: 0; transform: translateX(8px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes animated-background {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Bos Durum */
.genel-bos-durum {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 80px 24px;
  text-align: center;

  .genel-bos-ikon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #dbeafe, #a3c9f8);
  background-size: 200% 200%;
  position: relative;
  animation: aktif-kisi-giris 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
             animated-background 15s ease infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;

    .anticon {
      font-size: 36px;
      color: #3b82f6;
    }
  }

  h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
  }

  p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    max-width: 400px;
  }
}

/* Geri butonu */
.genel-geri-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: background 0.15s, box-shadow 0.15s;

  &:hover {
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  }
}

/* Chart Wrapper */
.genel-chart-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);

  /* FikoYT watermark - sabit, silik, capraz branding */
  &::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    width: min(60vw, 500px);
    height: min(16vw, 130px);
    max-width: 100%;
    background: url('/simgeler/fikoyt_yazi.png') center / contain no-repeat;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
  }
}

/* Agactan Sec Banner */
.agactan-sec-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  white-space: nowrap;
  animation: agactan-sec-pulse 2s ease-in-out infinite;

  .anticon {
    font-size: 16px;
    color: #f59e0b;
  }
}

@keyframes agactan-sec-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4); }
}

/* Loading Overlay */
.genel-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(4px);
  z-index: 10;

  p {
    margin-top: 12px;
    color: #64748b;
    font-size: 14px;
  }
}

/* SVG Container */
.genel-agac-container {
  width: 100%;
  height: 100%;

  .f3 {
    width: 100%;
    height: 100%;
    --background-color: transparent;
    --text-color: #1e293b;
    --male-color: #3b82f6;
    --female-color: #ec4899;
    --genderless-color: #94a3b8;
  }

  svg.main_svg {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    position: relative;
    z-index: 1;
  }

  #htmlSvg {
    z-index: 2 !important;
  }

  /* Connection Lines */
  .link {
    stroke: #94a3b8 !important;
    stroke-width: 2px !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    fill: none !important;
    opacity: 0.6;
    transition: stroke 0.3s ease, stroke-width 0.3s ease, opacity 0.3s ease;
  }

  .link-spouse {
    stroke-dasharray: 6 4 !important;
    stroke: #e879a2 !important;
    opacity: 0.5;
  }

  .link.highlight,
  .link.f3-path-to-main {
    stroke: #f59e0b !important;
    stroke-width: 3px !important;
    opacity: 1;
  }

  /* Card Containers */
  .card_cont {
    cursor: pointer;
    transition: opacity 0.2s ease;
  }

  /* Card Outlines */
  .card-outline {
    rx: 14 !important;
    ry: 14 !important;
    stroke-width: 2px !important;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
  }

  .card-male .card-outline {
    fill: #ffffff !important;
    stroke: #bfdbfe !important;
  }

  .card-female .card-outline {
    fill: #ffffff !important;
    stroke: #fbcfe8 !important;
  }

  .card-genderless .card-outline {
    fill: #ffffff !important;
    stroke: #cbd5e1 !important;
  }

  .card-main-outline {
    stroke: #f59e0b !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 2px 12px rgba(245, 158, 11, 0.3));
  }

  .card-new-outline {
    stroke-dasharray: 6 3 !important;
    opacity: 0.6;
  }

  .card-body-rect {
    fill: transparent !important;
  }

  .text-overflow-mask {
    fill: transparent !important;
  }

  .fit_screen_icon {
    rect {
      stroke: #94a3b8 !important;
    }
    circle {
      fill: #94a3b8 !important;
    }
  }
}

/* ================================================================= */
/*  SOY KART - Mevcut agac-goruntule stillerini yeniden kullan        */
/* ================================================================= */

.soy-kart {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 8px 12px;
  box-sizing: border-box;
  border-radius: 14px;
  position: relative;
  overflow: visible;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  cursor: pointer;
  transition: box-shadow 0.2s ease;

  &:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  }

  &::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #94a3b8;
  }

  &.erkek::before {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
  }

  &.kadin::before {
    background: linear-gradient(180deg, #ec4899, #db2777);
  }

  &.vefat {
    opacity: 0.7;
    &::before {
      background: #64748b !important;
    }
  }

  &.elle {
    border: 1px dashed #cbd5e1;
  }

  &.sanal {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    justify-content: center;
    opacity: 0.7;
    &::before {
      background: #cbd5e1;
    }
  }

  /* Karta tiklayinca → acik mavi odak */
  &.odak {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);

    &::before {
      background: linear-gradient(180deg, #60a5fa, #3b82f6) !important;
      width: 5px;
    }

    .soy-kart-isim {
      color: #1e3a5f;
      font-weight: 700;
    }

    .soy-kart-meslek,
    .soy-kart-tarih,
    .soy-kart-yer {
      color: #1e40af;
    }

    .soy-kart-akrabalik {
      background: #3b82f6 !important;
      color: #fff;
    }
  }

  /* Merkeze Al butonu → koyu portakal */
  &.aktif {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);

    &::before {
      background: linear-gradient(180deg, #ea580c, #c2410c) !important;
      width: 5px;
    }

    .soy-kart-isim {
      color: #7c2d12;
      font-weight: 700;
    }

    .soy-kart-meslek,
    .soy-kart-tarih,
    .soy-kart-yer {
      color: #9a3412;
    }

    .soy-kart-akrabalik {
      background: #ea580c !important;
      color: #fff;
    }
  }
}

.soy-kart-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .erkek & {
    border-color: #bfdbfe;
  }

  .kadin & {
    border-color: #fbcfe8;
  }
}

.soy-kart-avatar-fb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #94a3b8, #64748b);

  .erkek & {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
  }

  .kadin & {
    background: linear-gradient(135deg, #f472b6, #ec4899);
  }
}

.soy-kart-bilgi {
  flex: 1;
  min-width: 0;
  padding-left: 4px;
}

.soy-kart-isim {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soy-kart-kizlik {
  font-size: 10px;
  font-weight: 400;
  color: #a855f7;
  margin-left: 3px;
  font-style: italic;
}

.soy-kart-akrabalik {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  line-height: 1.4;
  margin-top: 1px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soy-kart-meslek {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soy-kart-tarih {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.4;
  margin-top: 1px;
}

.soy-kart-yer {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.4;
}

.soy-kart-btn-grup {
  position: absolute;
  top: 4px;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 5;

  .soy-kart:hover & {
    opacity: 1;
  }
}

.soy-kart-detay-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;

  &:hover {
    opacity: 1 !important;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
  }
}

.soy-kart-merkez-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;

  &:hover {
    opacity: 1 !important;
    background: rgba(234, 88, 12, 0.25);
    color: #c2410c;
  }
}

.soy-kart-vefat-serit {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #475569, #1e293b);
}

/* Gizli dugum/link animasyonlari */
.gizli-dugum {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease !important;
}

.gizli-link {
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

.card_cont {
  transition: opacity 0.3s ease !important;
}

.context-menu-wrapper {
  position: fixed; /* Ekran uzerinde sabit kalmasi icin */
  z-index: 1000;   /* Diger elemanlarin ustunde olmasi icin */
  visibility: hidden; /* nz-dropdown'in varsayilan gizleme mekanizmasi devrede */
  opacity: 0;       /* nz-dropdown'in varsayilan gizleme mekanizmasi devrede */
  pointer-events: none; /* Mouse olaylarini engelle */

  /* Dropdown menunun kendisi (nz-dropdown-menu icindeki ul) */
  ul.ant-dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;

    li.ant-dropdown-menu-item {
      padding: 8px 16px;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 8px;

      .anticon {
        font-size: 16px;
      }
    }
  }
}
