/* Import Rubik Font */
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* CSS Variables for consistent theming */
:root {
  /* Colors */
  --border-weak: #DFE6F5;
  --background-secondary: #FDFEFF;
  --text-strong: #040308;
  --text-white: #F5F5F5;
  --info-color: #0284C7;
  
  /* Label Palettes */
  --label-lilac-top: #F0E4FF;
  --label-lilac-bottom: #E0CCFF;
  --label-lilac-text: #6F2E94;

  --label-lavender-top: #F4E6FF;
  --label-lavender-bottom: #E7D5FF;
  --label-lavender-text: #713CDC;

  --label-rose-top: #F9DEEA;
  --label-rose-bottom: #F2C4D8;
  --label-rose-text: #A1376F;

  --label-sky-top: #D8F2FF;
  --label-sky-bottom: #BFE3FF;
  --label-sky-text: #177EB8;

  --label-jade-top: #D8F1E3;
  --label-jade-bottom: #C7E6D3;
  --label-jade-text: #1F7D41;

  --label-mint-top: #E3F6E9;
  --label-mint-bottom: #CEEAD6;
  --label-mint-text: #1E8D52;

  --label-amber-top: #FFF4CC;
  --label-amber-bottom: #FFE0A1;
  --label-amber-text: #A07205;

  --label-apricot-top: #FFE8D2;
  --label-apricot-bottom: #FFD5AF;
  --label-apricot-text: #C45E15;

  --label-cerise-top: #FADADF;
  --label-cerise-bottom: #F2BAC3;
  --label-cerise-text: #AD3251;

  --label-aqua-top: #D7F1F4;
  --label-aqua-bottom: #BFE3E8;
  --label-aqua-text: #2A7C8D;

  --label-periwinkle-top: #E0E7FF;
  --label-periwinkle-bottom: #CBD6FF;
  --label-periwinkle-text: #2E57C7;

  /* Accent greens retained for badges */
  --green-300: #75B783;
  --green-500: #198731;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Rubik', sans-serif;
/*  background: white;
  padding: 40px 20px;*/
}

/* Cards Container */
.cards-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 40px 20px;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Individual Card */
.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border-weak);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* clickable card helper (used by category pages) */
.card.clickable {
  cursor: pointer;
}

/* white background helper for card image area when showing logos */
.card-image.white-bg {
  background-color: #ffffff;
}

/* Kütüphaneler logos */
.logo-bg-millet { background-image: url('./images/logos/kutuphaneler/millet-kutuphanesi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-milli { background-image: url('./images/logos/kutuphaneler/milli-kutuphane.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-ttk { background-image: url('./images/logos/kutuphaneler/turk-tarih-kurumu.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-loc { background-image: url('./images/logos/kutuphaneler/library-of-congress.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-koha { background-image: url('./images/logos/kutuphaneler/koha-kutuphane-otomasyon-sistemi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-atauni { background-image: url('./images/logos/kutuphaneler/ataturk-universitesi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-tdk { background-image: url('./images/logos/kutuphaneler/turk-dil-kurumu.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }

.card-image.white-bg { display: flex; align-items: center; justify-content: center; }

/* Ansiklopediler logos */
.logo-bg-tubitak { background-image: url('./images/logos/ansiklopediler/tubitak.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-ataturk { background-image: url('./images/logos/ansiklopediler/ataturk-ansiklopedisi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-islam { background-image: url('./images/logos/ansiklopediler/islam-ansiklopedisi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-turkmaarif { background-image: url('./images/logos/ansiklopediler/turk-maarif-ansiklopedisi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-iep { background-image: url('./images/logos/ansiklopediler/iep.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-turkdunya { background-image: url('./images/logos/ansiklopediler/turk-dunyasi-ansiklopedisi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-teis { background-image: url('./images/logos/ansiklopediler/teis.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }


/* Gazete Arşivleri logos */
.logo-bg-gazeteden { background-image: url('./images/logos/gazete-arsivleri/gazeteden-tarihe-bakis.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-azerbaycan { background-image: url('./images/logos/gazete-arsivleri/azerbaycan-milli-kutuphane.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-europeana { background-image: url('./images/logos/gazete-arsivleri/europeana.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-deutsches { background-image: url('./images/logos/gazete-arsivleri/deutsches-zeitungsportal.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-chronicling { background-image: url('./images/logos/gazete-arsivleri/chronicling-america.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-anno { background-image: url('./images/logos/gazete-arsivleri/anno.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }

/* Dergiler logos */
.logo-bg-bilim-genc { background-image: url('./images/logos/dergiler/bilim-genc.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-ogretmeniz { background-image: url('./images/logos/dergiler/ogretmeniz.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-milli-egitim { background-image: url('./images/logos/dergiler/milli-egitim.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-tubitak-populer { background-image: url('./images/logos/dergiler/tubitak-populer-bilim.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-aselsan { background-image: url('./images/logos/dergiler/aselsan.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-tusas { background-image: url('./images/logos/dergiler/turk-havacilik-ve-uzay-sanayii.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-havelsan { background-image: url('./images/logos/dergiler/havelsan.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-maarif { background-image: url('./images/logos/dergiler/maarif.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-turk-dunyasi-dergi { background-image: url('./images/logos/dergiler/turk-dunyasi-dil-ve-edebiyat.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-turk-dili { background-image: url('./images/logos/dergiler/turk-dili.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-ayk { background-image: url('./images/logos/dergiler/ayk.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-belleten { background-image: url('./images/logos/dergiler/belleten.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-turk-kizilay { background-image: url('./images/logos/dergiler/turk-kizilay.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-turk-arkeoloji { background-image: url('./images/logos/dergiler/turk-arkeoloji-ve-etnografya.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-diyanet { background-image: url('./images/logos/dergiler/diyanet.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-trt-vizyon { background-image: url('./images/logos/dergiler/trt-vizyon.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-yesilay { background-image: url('./images/logos/dergiler/yesilay.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }

/* İstatistiki Veri Kanalları logos */
.logo-bg-tuik { background-image: url('./images/logos/istatistiki-veri-kanallari/tuik.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-oecd { background-image: url('./images/logos/istatistiki-veri-kanallari/oecd.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-unesco { background-image: url('./images/logos/istatistiki-veri-kanallari/unesco.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-worldbank { background-image: url('./images/logos/istatistiki-veri-kanallari/world-bank.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-google-dataset { background-image: url('./images/logos/istatistiki-veri-kanallari/google-dataset-search.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-oicstat { background-image: url('./images/logos/istatistiki-veri-kanallari/oicstat.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-eurostat { background-image: url('./images/logos/istatistiki-veri-kanallari/eurostat.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-harvard-growth { background-image: url('./images/logos/istatistiki-veri-kanallari/harvard-growth-lab.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }

/* Kurslar logos */
.logo-bg-btk-akademi { background-image: url('./images/logos/kurslar/btk-akademi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-hemba { background-image: url('./images/logos/kurslar/hemba.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-bilgeis { background-image: url('./images/logos/kurslar/bilgeis.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-edx { background-image: url('./images/logos/kurslar/edx.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }

/* Akademik Araştırma Siteleri logos */
.logo-bg-tr-dizin { background-image: url('./images/logos/akademik-arastirma/tr-dizin.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-dergipark { background-image: url('./images/logos/akademik-arastirma/dergipark.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-yok-tez { background-image: url('./images/logos/akademik-arastirma/yok-tez-merkezi.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-google-akademik { background-image: url('./images/logos/akademik-arastirma/google-akademik.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }
.logo-bg-science-gov { background-image: url('./images/logos/akademik-arastirma/science-gov.png'); background-size: min(140px, 80%); background-repeat: no-repeat; background-position: center; }

/* Card Image Section */
.card-image {
  width: 100%;
  aspect-ratio: 320 / 200;
  position: relative;
  background-size: cover;
  background-position: center;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  overflow: hidden;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

/* Logos placed inside image area (used on category pages) */
.logo-in-image {
  object-fit: contain;
  pointer-events: none;
}

/* New Badge */
.new-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 2px 4px;
  background: linear-gradient(0deg, var(--green-500) 0%, var(--green-300) 100%);
  border-radius: 50px;
  color: var(--text-white);
  font-size: 10px;
  font-weight: 400;
}

/* Animated pulse for "Yeni" badges (fade in/out subtly) */
.new-badge {
  animation: badge-fade 1s ease-in-out infinite;
  will-change: opacity, transform;
}

@keyframes badge-fade {
  0% { opacity: 1; }
  50% { opacity: 0.75; }
    100% { opacity: 1; }
}

/* Category Label */
.category-label {
  height: 24px;
  padding: 0 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  box-shadow: 0 2px 4px rgba(20, 32, 75, 0.1);
  white-space: nowrap;
}

/* Label Colors */
.label-lilac {
  background: linear-gradient(180deg, var(--label-lilac-top) 0%, var(--label-lilac-bottom) 100%);
  color: var(--label-lilac-text);
}

.label-lavender {
  background: linear-gradient(180deg, var(--label-lavender-top) 0%, var(--label-lavender-bottom) 100%);
  color: var(--label-lavender-text);
}

.label-rose {
  background: linear-gradient(180deg, var(--label-rose-top) 0%, var(--label-rose-bottom) 100%);
  color: var(--label-rose-text);
}

.label-sky {
  background: linear-gradient(180deg, var(--label-sky-top) 0%, var(--label-sky-bottom) 100%);
  color: var(--label-sky-text);
}

.label-jade {
  background: linear-gradient(180deg, var(--label-jade-top) 0%, var(--label-jade-bottom) 100%);
  color: var(--label-jade-text);
}

.label-mint {
  background: linear-gradient(180deg, var(--label-mint-top) 0%, var(--label-mint-bottom) 100%);
  color: var(--label-mint-text);
}

.label-amber {
  background: linear-gradient(180deg, var(--label-amber-top) 0%, var(--label-amber-bottom) 100%);
  color: var(--label-amber-text);
}

.label-apricot {
  background: linear-gradient(180deg, var(--label-apricot-top) 0%, var(--label-apricot-bottom) 100%);
  color: var(--label-apricot-text);
}

.label-cerise {
  background: linear-gradient(180deg, var(--label-cerise-top) 0%, var(--label-cerise-bottom) 100%);
  color: var(--label-cerise-text);
}

.label-aqua {
  background: linear-gradient(180deg, var(--label-aqua-top) 0%, var(--label-aqua-bottom) 100%);
  color: var(--label-aqua-text);
}

.label-periwinkle {
  background: linear-gradient(180deg, var(--label-periwinkle-top) 0%, var(--label-periwinkle-bottom) 100%);
  color: var(--label-periwinkle-text);
}

/* Card Content */
.card-content {
  padding: 12px 24px;
  background: var(--background-secondary);
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--border-weak);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  position: relative;
}

.card-title {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  max-width: calc(100% - 24px); /* leave space for info icon */

}

/* Info Icon */
.info-icon {
  width: 16px;
  height: 16px;
  position: absolute;
  right: 14px;
  top: 14px;
  cursor: pointer;
}

.info-icon svg {
  width: 100%;
  height: 100%;
  fill: var(--info-color);
}

/* Tooltip */
.tooltip {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  padding: 12px;
  background: white;
  border: 1px solid var(--border-weak);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-strong);
  width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 0.2s ease;
  z-index: 10;
}

.info-icon:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* When tooltip is explicitly opened (via JS toggle) use same visible styles */
.tooltip.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Background Images */
.card-dijital-kutuphaneler { background-image: url('./images/dijital-kutuphaneler.jpeg'); }
.card-akademik-arastirma { background-image: url('./images/akademik-arastirma-siteleri.jpeg'); }
.card-cevrim-ici-kurslar { background-image: url('./images/cevrim-ici-kurslar.jpeg'); }
.card-istatistiki-veriler { background-image: url('./images/istatistiki-veri-kanallari.jpeg'); }
.card-kutuphaneler { background-image: url('./images/kutuphaneler.jpeg'); }
.card-ansiklopediler { background-image: url('./images/ansiklopediler.jpeg'); }
.card-gazete-arsivleri { background-image: url('./images/gazete-arsivleri.jpeg'); }
.card-dergiler { background-image: url('./images/dergiler.jpeg'); }

/* Responsive Design */
@media (max-width: 1200px) {
  .cards-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cards-container {
    grid-template-columns: 1fr;
    padding: 0;
  }
  
  .card {
    width: 100%;
  }
  
  .card-image {
    height: auto;
    aspect-ratio: 320 / 200;
    min-height: 200px;
  }
}