/* =============================================
   YKS Tercih Robotu Modern UI
   ============================================= */

/* ========== HERO SECTION ========== */
.yks-hero {
  background: linear-gradient(135deg, rgb(30, 39, 98) 0%, #0d2b4a 50%, #1a1a2e 100%);
  color: #fff;
  padding: 72px 5% 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.yks-hero::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(194,0,0,.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.yks-hero::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(251,197,49,.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.yks-hero__inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  animation: yks-fadeUp .6s ease;
}
.yks-hero__title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.yks-hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #cbd5e1;
  margin: 0 0 28px;
  line-height: 1.7;
  font-weight: 400;
}
.yks-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #c20000, #e63946);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(194, 0, 0, .3);
  transition: transform .2s, filter .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.yks-hero__cta::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80px;
  width: 60px;
  height: 100%;
  background: rgba(255,255,255,.25);
  transform: skewX(-20deg);
  animation: yks-shine 3s infinite;
}
.yks-hero__cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 36px rgba(194, 0, 0, .35);
}

.yks-hero__badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
.yks-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: .3px;
}

/* ========== PAGE LAYOUT (single column, wide) ========== */
.yks-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 4% 48px;
  display: block;
}
.yks-main {
  min-width: 0;
  max-width: 100%;
}

/* ========== CARD ========== */
.yks-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 28px;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 4px 20px rgba(0,0,0,.05);
  animation: yks-fadeUp .4s ease;
}
.yks-card--accent {
  border-top: 3px solid #c20000;
}
#filterCard {
  scroll-margin-top: 90px;
}
.yks-card__header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}
.yks-card__title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d2b4a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.yks-card__icon {
  font-size: 1.2rem;
}
.yks-card__desc {
  margin: 0;
  font-size: .9rem;
  color: #6b7280;
}

/* ========== SELECTION MODE TOGGLE ========== */
.yks-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  width: fit-content;
}
.yks-mode-toggle__btn {
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .25s ease;
  background: transparent;
  color: #6b7280;
  white-space: nowrap;
}
.yks-mode-toggle__btn.active {
  background: linear-gradient(135deg, #c20000, #e63946);
  color: #fff;
  box-shadow: 0 4px 14px rgba(194,0,0,.18);
}
.yks-mode-toggle__btn:not(.active):hover {
  background: #e5e7eb;
  color: #374151;
}

/* ========== FORM ========== */
.yks-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  align-items: end;
}
.yks-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.yks-form-group label {
  font-size: .85rem;
  font-weight: 700;
  color: #374151;
  margin-left: 2px;
}
.yks-form-helper {
  font-size: .75rem;
  color: #9ca3af;
  margin-left: 2px;
  margin-bottom: 2px;
}

.yks-page input,
.yks-page select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: .92rem;
  font-family: inherit;
  background: #fafbfc;
  color: #1f2937;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
  height: 44px;
}
.yks-page input:focus,
.yks-page select:focus {
  outline: none;
  border-color: #c20000;
  box-shadow: 0 0 0 3px rgba(194,0,0,.10);
  background: #fff;
}
/* Disabled input styling (puan/sıralama toggle) */
.yks-page input.is-disabled,
.yks-page input:disabled,
.yks-page select.is-disabled,
.yks-page select:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
  opacity: .6;
}

.yks-range-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.yks-button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
  padding-top: 18px;
  border-top: 1px solid #f0f0f0;
}

/* ========== BUTTONS ========== */
.yks-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.yks-btn--primary {
  background: linear-gradient(135deg, #c20000, #e63946);
  color: #fff;
  box-shadow: 0 4px 16px rgba(194,0,0,.18);
  padding: 12px 28px;
  position: relative;
}
.yks-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(194,0,0,.25);
  filter: brightness(1.06);
}
.yks-btn--primary .yks-btn__spinner {
  display: none;
}
.yks-btn--primary.is-loading .yks-btn__text {
  opacity: 0;
}
.yks-btn--primary.is-loading .yks-btn__spinner {
  display: block;
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: yks-spin .6s linear infinite;
}

.yks-btn--ghost {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  padding: 12px 28px;
}
.yks-btn--ghost:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.yks-btn--outline {
  background: #fff;
  color: #4b5563;
  border: 1.5px solid #d1d5db;
}
.yks-btn--outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.yks-btn--success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5,150,105,.18);
}
.yks-btn--success:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.yks-btn--page {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  padding: 8px 18px;
  font-size: .85rem;
  border-radius: 8px;
}
.yks-btn--page:hover {
  background: #e5e7eb;
}

.yks-btn--sm {
  padding: 5px 10px;
  font-size: .78rem;
  border-radius: 6px;
  background: #6b7280;
  color: #fff;
}
.yks-btn--sm:hover {
  background: #4b5563;
}
.yks-btn--danger {
  background: #dc2626 !important;
}
.yks-btn--danger:hover {
  background: #b91c1c !important;
}

/* JS-generated Ekle/Çıkar buttons */
button {
  font-family: inherit;
}
.btn-ekle {
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  background: linear-gradient(135deg, #059669, #10b981) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(5,150,105,.18);
}
.btn-ekle:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-cikar {
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(220,38,38,.18);
}
.btn-cikar:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ========== SEARCH BAR ========== */
.yks-search-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.yks-search-bar__input-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
  min-width: 200px;
}
.yks-search-bar__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}
.yks-search-bar__input-wrap input {
  padding-left: 40px;
}
.yks-search-bar__count {
  font-size: .9rem;
  color: #6b7280;
  font-weight: 600;
}
.yks-badge-count {
  display: inline-block;
  background: linear-gradient(135deg, #c20000, #e63946);
  color: #fff;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .3px;
}

/* ========== TABLE ========== */
.yks-page .table-responsive {
  overflow-x: auto;
  min-height: 200px;
  -webkit-overflow-scrolling: touch;
}
.yks-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  table-layout: auto;
}

/* Main results table column widths */
#yksMainTable { table-layout: fixed; }
#yksMainTable > thead > tr > th:nth-child(1) { width: 22%; }  /* Üniversite */
#yksMainTable > thead > tr > th:nth-child(2) { width: 22%; }  /* Program */
#yksMainTable > thead > tr > th:nth-child(3) { width: 10%; }  /* Şehir */
#yksMainTable > thead > tr > th:nth-child(4) { width: 10%; }  /* Puan Türü */
#yksMainTable > thead > tr > th:nth-child(5) { width: 12%; }  /* Taban Puan */
#yksMainTable > thead > tr > th:nth-child(6) { width: 10%; }  /* Kontenjan */
#yksMainTable > thead > tr > th:nth-child(7) { width: 14%; }  /* İşlem */

/* Compact Ekle/Çıkar buttons */
.btn-ekle, .btn-cikar {
  padding: 6px 12px;
  font-size: .78rem;
  white-space: nowrap;
}

/* Tercih Listesi column widths */
#yksPrefTable { table-layout: fixed; }
#yksPrefTable > thead > tr > th:nth-child(1)  { width: 5%; }   /* # */
#yksPrefTable > thead > tr > th:nth-child(2)  { width: 22%; }  /* Üniversite */
#yksPrefTable > thead > tr > th:nth-child(3)  { width: 22%; }  /* Program */
#yksPrefTable > thead > tr > th:nth-child(4)  { width: 10%; }  /* Şehir */
#yksPrefTable > thead > tr > th:nth-child(5)  { width: 10%; }  /* Puan Türü */
#yksPrefTable > thead > tr > th:nth-child(6)  { width: 12%; }  /* Taban Puan */
#yksPrefTable > thead > tr > th:nth-child(7)  { width: 7%; }   /* Kontenjan */
#yksPrefTable > thead > tr > th:nth-child(8)  { width: 12%; }  /* İşlem */

.yks-page th {
  font-weight: 700;
  color: #374151;
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
  padding: 12px 10px;
  text-align: left;
  user-select: none;
  white-space: normal;
  vertical-align: middle;
  position: sticky;
  top: 0;
  z-index: 5;
}
.yks-page th:hover {
  background: #f0f4f8;
  color: #0d2b4a;
}
.yks-page td {
  border-bottom: 1px solid #f0f0f0;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  color: #374151;
  white-space: normal;
  word-break: break-word;
}

/* Truncated program/university names */
.yks-truncate {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Zebra rows */
#yksSonucBody tr:nth-child(even),
#yksTercihBody tr:nth-child(even) {
  background: #fafbfc;
}
#yksSonucBody tr:hover,
#yksTercihBody tr:hover {
  background: #f0f7ff;
  transition: background .15s;
}

/* ========== PAGINATION ========== */
.yks-pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
}
.yks-page-info {
  padding: 0 14px;
  font-weight: 700;
  font-size: .9rem;
  color: #374151;
}

/* ========== PREFERENCE LIST HEADER ========== */
.yks-pref-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.yks-pref-header__title {
  font-weight: 800;
  color: #0d2b4a;
  font-size: 1.15rem;
}
.yks-pref-header__actions {
  display: flex;
  gap: 8px;
}

/* ========== TERCIH ACTIONS (▲▼X inline) ========== */
.tercih-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

/* ========== EMPTY STATE ========== */
.yks-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}
.yks-empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: .5;
}
.yks-empty-state__text {
  font-size: .95rem;
  font-weight: 600;
}

/* ========== MOBILE NAVBAR AUTO-HIDE ========== */
.navbar {
  transition: transform .3s ease;
}
.navbar--hidden {
  transform: translateY(-100%);
}

/* ========== ANIMATIONS ========== */
@keyframes yks-fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes yks-spin {
  to { transform: rotate(360deg); }
}
@keyframes yks-shine {
  0%   { left: -90px; }
  40%  { left: 120%; }
  100% { left: 120%; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .yks-page {
    padding: 28px 3% 40px;
  }
}
@media (max-width: 768px) {
  .yks-hero {
    padding: 52px 5% 40px;
  }
  .yks-hero__title {
    font-size: 1.8rem;
  }
  .yks-filter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .yks-search-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .yks-search-bar__input-wrap {
    max-width: 100%;
  }
  .yks-pref-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .yks-button-group {
    flex-direction: column;
  }
  .yks-button-group .yks-btn {
    width: 100%;
  }
  .yks-mode-toggle {
    width: 100%;
  }
  .yks-mode-toggle__btn {
    flex: 1;
    text-align: center;
  }
}
@media (max-width: 480px) {
  .yks-filter-grid {
    grid-template-columns: 1fr;
  }
  .yks-hero__badges {
    flex-direction: column;
    align-items: center;
  }
  td, th {
    padding: 8px 6px;
    font-size: .8rem;
  }

  /* PORTRAIT: Hide less important columns in results table */
  /* Visible: Üniversite(1), Program(2), Taban Puan(5), İşlem(7) */
  #yksMainTable > thead > tr > th:nth-child(3),
  #yksMainTable > thead > tr > th:nth-child(4),
  #yksMainTable > thead > tr > th:nth-child(6),
  #yksMainTable > tbody > tr > td:nth-child(3),
  #yksMainTable > tbody > tr > td:nth-child(4),
  #yksMainTable > tbody > tr > td:nth-child(6) {
    display: none;
  }

  /* Portrait column widths – visible columns */
  #yksMainTable > thead > tr > th:nth-child(1) { width: 35%; }
  #yksMainTable > thead > tr > th:nth-child(2) { width: 30%; }
  #yksMainTable > thead > tr > th:nth-child(5) { width: 18%; }
  #yksMainTable > thead > tr > th:nth-child(7) { width: 17%; }

  /* PORTRAIT: Tercih table – hide Şehir(4), Puan Türü(5) */
  #yksPrefTable > thead > tr > th:nth-child(4),
  #yksPrefTable > thead > tr > th:nth-child(5),
  #yksPrefTable > thead > tr > th:nth-child(7),
  #yksPrefTable > tbody > tr > td:nth-child(4),
  #yksPrefTable > tbody > tr > td:nth-child(5),
  #yksPrefTable > tbody > tr > td:nth-child(7) {
    display: none;
  }

  #yksPrefTable > thead > tr > th:nth-child(1)  { width: 8%; }
  #yksPrefTable > thead > tr > th:nth-child(2)  { width: 32%; }
  #yksPrefTable > thead > tr > th:nth-child(3)  { width: 28%; }
  #yksPrefTable > thead > tr > th:nth-child(6)  { width: 14%; }
  #yksPrefTable > thead > tr > th:nth-child(8)  { width: 18%; }
}

/* ========== PRINT ========== */
@media print {
  body * { visibility: hidden; }
  #printableArea, #printableArea * { visibility: visible; }
  #printableArea { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
  .yks-card { border: none; box-shadow: none; }
  .yks-hero, .tab-buttons { display: none !important; }
}
