/* =====================================================
   FAKÜLTELER VE BÖLÜMLER BÖLÜMÜ - Rankings Tab İçin
   ===================================================== */

/* =====================================================
   FAKÜLTE FİLTRE PANELİ
   ===================================================== */

.faculty-filter-panel {
    background: linear-gradient(135deg, #f8fffe 0%, #e8f5f2 100%);
    border: 1px solid #d0e8e4;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(26, 77, 62, 0.08);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    background: linear-gradient(135deg, #1A4D3E 0%, #2d6a5a 100%);
    transition: all 0.3s ease;
}

.filter-header:hover {
    background: linear-gradient(135deg, #163f33 0%, #256050 100%);
}

.filter-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-icon {
    font-size: 18px;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.filter-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
}

.filter-toggle-icon {
    font-size: 14px;
    color: white;
    transition: transform 0.3s ease;
}

.faculty-filter-panel.collapsed .filter-toggle-icon {
    transform: rotate(180deg);
}

.filter-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
    /* Panel açıkken toplam yükseklik sınırlı; kaydırma sadece grid içinde */
    max-height: min(78vh, 720px);
    overflow: hidden;
}

.faculty-filter-panel.collapsed .filter-content {
    display: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 0;
    align-self: stretch;
    width: 100%;
    max-height: min(58vh, 520px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: 6px;
}

.filter-grid::-webkit-scrollbar {
    width: 8px;
}

.filter-grid::-webkit-scrollbar-thumb {
    background: rgba(26, 77, 62, 0.28);
    border-radius: 8px;
}

.filter-grid::-webkit-scrollbar-track {
    background: rgba(26, 77, 62, 0.06);
    border-radius: 8px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e0e8e6;
    box-shadow: 0 4px 12px rgba(26, 77, 62, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: fit-content;
}

.filter-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    background: #fcfdfc;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
}

.filter-item-header:hover {
    background: #f5f9f8;
}

.filter-item-header label {
    margin-bottom: 0 !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #1A4D3E;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item.expanded .filter-item-header {
    border-bottom: 1px solid #eef3f2;
}

.filter-item-content {
    padding: 16px;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.filter-item.expanded .filter-item-content {
    display: block;
}

.filter-item .toggle-icon {
    font-size: 10px;
    color: #1A4D3E;
    transition: transform 0.3s;
}

.filter-item.expanded .toggle-icon {
    transform: rotate(180deg);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-item.filter-search {
    grid-column: span 1;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 140px;
    overflow-y: auto;
    padding: 10px;
    background: #fcfdfc;
    border: 1px solid #e8f0ee;
    border-radius: 10px;
}

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

@media (max-width: 600px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.filter-item label {
    font-size: 13px;
    font-weight: 600;
    color: #1A4D3E;
}

.filter-item input {
    padding: 12px 16px;
    border: 1px solid #e0e8e6;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
    color: #333;
}

.filter-item input:focus {
    outline: none;
    border-color: #1A4D3E;
    box-shadow: 0 0 0 3px rgba(26, 77, 62, 0.1);
}

.filter-item input::placeholder {
    color: #aaa;
}

.filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid #d0e8e4;
    flex-shrink: 0;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-inputs input {
    flex: 1;
    min-width: 0;
    /* Inputların taşmasını önler */
}

/* Checkbox Item Styles */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    line-height: 1.4;
}

.checkbox-item:hover {
    color: #1A4D3E;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1A4D3E;
    margin: 0 !important;
}

/* Custom scrollbar for checkbox list */
.checkbox-list::-webkit-scrollbar {
    width: 6px;
}

.checkbox-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.checkbox-list::-webkit-scrollbar-thumb {
    background: #c1d3ce;
    border-radius: 10px;
}

.checkbox-list::-webkit-scrollbar-thumb:hover {
    background: #1A4D3E;
}

.range-separator {
    color: #1A4D3E;
    font-weight: 600;
}

.filter-btn-apply {
    background: linear-gradient(135deg, #1A4D3E 0%, #2d6a5a 100%);
    color: white;
}

.filter-btn-apply:hover {
    background: linear-gradient(135deg, #163f33 0%, #245a4e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 77, 62, 0.3);
}

.filter-btn-reset {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.filter-btn-reset:hover {
    background: #eee;
    color: #333;
}

/* Filter Active State */
.filter-active .filter-header {
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
}

.filter-active .filter-count {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .faculty-accordion.active .faculty-accordion-content {
        overflow-x: visible;
        overflow-y: visible;
        max-width: 100%;
        min-width: 0;
    }

    .filter-content {
        max-height: min(82vh, 680px);
    }

    .filter-grid {
        max-height: min(62vh, 460px);
        grid-template-columns: 1fr;
    }

    .filter-item.filter-search {
        grid-column: span 1;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
    }
}

.faculties-section {
    margin-top: 20px;
}

.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1A4D3E;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Faculty Accordion */
.faculty-accordion {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faculty-accordion:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.faculty-accordion-header {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1A4D3E 0%, #2d6a5a 100%);
    transition: background 0.2s;
}

.faculty-accordion-header:hover {
    background: linear-gradient(135deg, #163f33 0%, #256050 100%);
}

.faculty-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0 0 4px 0;
}

.faculty-dept-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

.faculty-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.faculty-konum-badge {
    font-size: 14px;
    font-weight: 700;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.accordion-icon {
    font-size: 18px;
    color: white;
    transition: transform 0.3s;
}

.faculty-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

/* Açık accordion için max-height sınırlaması kaldır */
.faculty-accordion.active .faculty-accordion-content {
    max-height: none !important;
    overflow: visible;
}

/* Departments Grid */
.departments-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 16px;
    background: #f8f9fa;
    min-width: 0;
}

/* Department Card */
.dept-card {
    background: white;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Sıralamalar: bölüm kartı üstü — yurt-detay ile aynı 3×3 (sembolik görsel) */
.dept-card-visual {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f5f5f0;
    overflow: hidden;
}

.dept-card-visual-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.dept-card-visual .gallery-overlay-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: minmax(44px, auto) minmax(48px, auto) minmax(64px, 1fr);
    gap: 6px;
    padding: 10px;
    pointer-events: none;
    align-items: stretch;
    box-sizing: border-box;
}

.dept-card-visual .gallery-overlay-grid > .gallery-fav-btn,
.dept-card-visual .gallery-overlay-grid > .gallery-km-block,
.dept-card-visual .gallery-overlay-grid > .gallery-dk-tile {
    pointer-events: auto;
}

.dept-card-visual .gallery-overlay-grid > .gallery-cell--empty:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dept-card-visual .gallery-overlay-grid > .gallery-cell--empty:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.dept-card-visual .gallery-overlay-grid > .gallery-cell--empty:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}

.dept-card-visual .gallery-overlay-grid > .gallery-cell--empty:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
}

.dept-card-visual .gallery-fav-btn {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    color: #1a4d3e;
    padding: 0;
}

.dept-card-visual .gallery-fav-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.dept-card-visual .gallery-fav-btn.is-favorite {
    color: #c62828;
}

.dept-card-visual .gallery-fav-btn:focus-visible {
    outline: 2px solid #1a4d3e;
    outline-offset: 2px;
}

.dept-card-visual .gallery-fav-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.dept-card-visual .gallery-km-block {
    grid-column: 3;
    grid-row: 2;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 6px 8px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(26, 77, 62, 0.12);
    min-height: 0;
}

.dept-card-visual .gallery-km-heading {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #145e43;
    margin-bottom: 2px;
}

.dept-card-visual .gallery-km-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a4d3e;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.dept-card-visual .gallery-dk-tile {
    grid-row: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 3px;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(26, 77, 62, 0.12);
    min-height: 0;
}

.dept-card-visual .gallery-overlay-grid > .gallery-dk-tile:nth-child(7) {
    grid-column: 1;
}

.dept-card-visual .gallery-overlay-grid > .gallery-dk-tile:nth-child(8) {
    grid-column: 2;
}

.dept-card-visual .gallery-overlay-grid > .gallery-dk-tile:nth-child(9) {
    grid-column: 3;
}

.dept-card-visual .gallery-dk-tile-ic {
    font-size: 1rem;
    line-height: 1;
}

.dept-card-visual .gallery-dk-tile-lbl {
    font-size: 0.62rem;
    font-weight: 700;
    color: #374151;
    line-height: 1.15;
}

.dept-card-visual .gallery-dk-tile-val {
    font-size: 0.82rem;
    font-weight: 800;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.dept-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 14px;
    padding: 14px 16px 10px;
    border-bottom: 2px solid #1A4D3E;
}

.dept-title {
    font-size: 16px;
    font-weight: 700;
    color: #1A4D3E;
    margin: 0;
    flex: 1;
}

.dept-city {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s;
    color: #ccc;
}

.fav-btn:hover {
    background: #fce4ec;
    color: #e91e63;
}

.fav-btn.active {
    color: #e91e63;
}

.fav-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.dept-card .programs-list {
    padding: 0 16px 16px;
}

.programs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Program Group - Ücret türüne göre gruplandırılmış */
.program-group {
    background: #fafafa;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s;
}

.program-group:hover {
    border-color: #1A4D3E;
    box-shadow: 0 2px 8px rgba(26, 77, 62, 0.1);
}

.program-group-title {
    font-size: 14px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    display: inline-block;
}

.program-group-title.burslu {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.program-group-title.ucretli {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-left: 4px solid #c62828;
}

.program-group-title.indirimli {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #ef6c00;
    border-left: 4px solid #ef6c00;
}

/* Fee Status Large - Satırda büyük badge */
.fee-status-large {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
}

.fee-status-large.burslu {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.fee-status-large.ucretli {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}

.fee-status-large.indirimli {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #ef6c00;
}

/* Tek satır: rozetler + D/Ö/T + favori (dar ekranda rozet alanı yatay kayar) */
.program-group-header {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    min-width: 0;
}

.program-group-header-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    flex: 1 1 0%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
}

.program-group-header-tags::-webkit-scrollbar {
    height: 4px;
}

.program-group-header-tags::-webkit-scrollbar-thumb {
    background: rgba(26, 77, 62, 0.25);
    border-radius: 4px;
}

.program-group-header-tags > * {
    flex-shrink: 0;
    white-space: nowrap;
}

.program-group-header-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Bolum-siralama ile aynı: sağda D/Ö/T + favori (Okul-siralama.css .dept-actions-icons) */
.program-group-header-actions.dept-actions-icons {
    margin-left: auto;
}

/* Sıralamalar: yurt paneli tablonun altında (Bolum-siralama ile aynı bileşen sınıfları) */
.program-group.dept-card-yurt-open .program-group-header {
    border-bottom: none;
    padding-bottom: 10px;
}

/* Yıllık tablo — sığınca kaydırma yok; yalnızca çok dar ekranda kayar */
.years-table-scroll {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: hidden;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    background: #fff;
}

.years-table-scroll .years-table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
}

/* Years Table - Yıllara göre tablo */
.years-table {
    border-collapse: collapse;
    font-size: 13px;
}

.years-table thead {
    background: linear-gradient(135deg, #1A4D3E 0%, #2d6a5a 100%);
}

.years-table th {
    color: white;
    font-weight: 600;
    padding: 10px 6px;
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.years-table td {
    padding: 12px 6px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.years-table .score-cell {
    color: #1A4D3E;
    font-weight: 700;
    word-break: break-all;
    white-space: normal;
    line-height: 1.25;
}

.years-table tbody tr:hover {
    background: #f0f7f5;
}

.years-table tbody tr:last-child td {
    border-bottom: none;
}

.years-table .year-cell {
    font-weight: 800;
    color: #1A4D3E;
    background: #e8f5e9;
    border-radius: 4px;
}

.years-table .doldu {
    color: #c62828;
    font-weight: 600;
}

.years-table .bos {
    color: #2e7d32;
    font-weight: 600;
}

/* Bölüm Sıralama Badge - Yeşil yuvarlak rozet */
.bolum-sira-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #1A4D3E 0%, #2d6a5a 100%);
    color: white;
    font-size: 12px;
    font-weight: 800;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(26, 77, 62, 0.4);
}

/* Info Tooltip - İndirimli ücret ve not için */
.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    cursor: help;
    position: relative;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.info-tooltip:hover {
    opacity: 1;
}

.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: normal;
    max-width: 280px;
    min-width: 150px;
    text-align: left;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

.info-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.info-tooltip:hover::after,
.info-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Sıralamalar tablosu: Kont / İçerik bilgi kutusu kesilmesin */
#rankings .faculty-accordion,
#rankings .faculty-accordion.active .faculty-accordion-content,
#rankings .dept-card,
#rankings .programs-list,
#rankings .program-group {
    overflow: visible;
}

#rankings .years-table-scroll {
    overflow: visible;
}

#rankings .years-table th,
#rankings .years-table td {
    overflow: visible;
    text-overflow: clip;
}

#rankings .years-table tbody tr {
    position: relative;
}

#rankings .years-table .info-tooltip {
    z-index: 5;
}

#rankings .years-table .info-tooltip:hover {
    z-index: 1200;
}

/* Yukarıdaki thead yerine aşağı açılır — kırpılma olmaz */
#rankings .years-table .info-tooltip::after {
    bottom: auto;
    top: calc(100% + 10px);
    margin-bottom: 0;
    pointer-events: none;
}

#rankings .years-table .info-tooltip::before {
    bottom: auto;
    top: calc(100% + 4px);
    margin-bottom: 0;
    border-top-color: transparent;
    border-bottom-color: #333;
    pointer-events: none;
}

/* Program Row - Eski tasarım (geriye uyumluluk) */
.program-row {
    background: #fafafa;
    border-radius: 8px;
    padding: 14px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s;
}

.program-row:hover {
    border-color: #1A4D3E;
    background: #f5f9f8;
    box-shadow: 0 2px 8px rgba(26, 77, 62, 0.1);
}

/* Program Top Row - Badges */
.program-info-top {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.program-type {
    font-size: 11px;
    font-weight: 700;
    color: #1A4D3E;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 4px;
}

/* Veri Yılı Badge (2025, 2024, etc.) */
.veri-yili-badge {
    font-size: 12px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #1A4D3E 0%, #2d6a5a 100%);
    padding: 4px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(26, 77, 62, 0.3);
}

.score-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-say {
    background: #e3f2fd;
    color: #1976d2;
}

.score-söz {
    background: #fff3e0;
    color: #f57c00;
}

.score-dil {
    background: #f3e5f5;
    color: #7b1fa2;
}

.score-ea {
    background: #e8f5e9;
    color: #388e3c;
}

.score-tyt {
    background: #fce4ec;
    color: #c2185b;
}

.edu-type {
    font-size: 10px;
    font-weight: 500;
    color: #555;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
}

.edu-lang {
    font-size: 10px;
    font-weight: 600;
    color: #0277bd;
    background: #e1f5fe;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Ücret Durumu Badge */
.fee-status {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.fee-status.burslu {
    background: #e8f5e9;
    color: #2e7d32;
}

.fee-status.ucretli {
    background: #ffebee;
    color: #c62828;
}

.fee-status.indirimli {
    background: #fff3e0;
    color: #ef6c00;
}

/* Doluluk Badge */
.doluluk-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.doluluk-badge.doldu {
    background: #ffebee;
    color: #c62828;
}

.doluluk-badge.bos {
    background: #e8f5e9;
    color: #2e7d32;
}

/* MTOK Badge */
.mtok-badge {
    font-size: 10px;
    font-weight: 700;
    background: #fce4ec;
    color: #ad1457;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Cinsiyet Badge */
.cinsiyet-badge {
    font-size: 10px;
    font-weight: 600;
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Kurum Badge */
.kurum-badge {
    font-size: 10px;
    font-weight: 600;
    background: #e0f2f1;
    color: #00695c;
    padding: 3px 8px;
    border-radius: 4px;
}

/* KKTC Badge */
.kktc-badge {
    font-size: 10px;
    font-weight: 600;
    background: #fff8e1;
    color: #ff8f00;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Farklı Konum Banner - Kırmızı */
.farklı-konum-banner {
    background: linear-gradient(135deg, #c62828 0%, #e53935 100%);
    color: white;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.3);
}

/* Özel Üniversite Text */
.ozel-uni-text {
    background: #f5f5f5;
    color: #555;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid #e0e0e0;
}

/* MTOK Banner - Büyük dikkat çekici başlık */
.mtok-banner {
    background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
    color: white;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.3);
}

/* MTOK Program Group - özel kenarlık */
.mtok-program {
    border: 2px solid #ff9800 !important;
    border-radius: 10px;
}

/* Special Program Group - MTOK, Cinsiyet, Kurum veya OzelUniversite içeren programlar */
.special-program {
    background: linear-gradient(135deg, #fafafa 0%, #f0f4f8 100%);
    border: 2px solid #90a4ae !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.special-program:hover {
    border-color: #607d8b !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Cinsiyet Banner */
.cinsiyet-banner {
    background: linear-gradient(135deg, #7b1fa2 0%, #9c27b0 100%);
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(123, 31, 162, 0.3);
}

/* Kurum Banner */
.kurum-banner {
    background: linear-gradient(135deg, #00695c 0%, #00897b 100%);
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 105, 92, 0.3);
}

/* Özel Üniversite Banner */
.ozel-uni-banner {
    background: linear-gradient(135deg, #0277bd 0%, #039be5 100%);
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(2, 119, 189, 0.3);
}

/* Banner kombinasyonları için border-radius düzeltmeleri */
.mtok-program .mtok-banner,
.special-program .cinsiyet-banner,
.special-program .kurum-banner,
.special-program .ozel-uni-banner,
.special-program .farklı-konum-banner {
    margin: -16px -16px 12px -16px;
    border-radius: 8px 8px 0 0;
}

/* Birden fazla banner varsa ara bannerların radius'unu kaldır */
.mtok-banner+.cinsiyet-banner,
.mtok-banner+.kurum-banner,
.mtok-banner+.farklı-konum-banner,
.mtok-banner+.ozel-uni-banner,
.cinsiyet-banner+.kurum-banner,
.cinsiyet-banner+.farklı-konum-banner,
.cinsiyet-banner+.ozel-uni-banner,
.kurum-banner+.farklı-konum-banner,
.kurum-banner+.ozel-uni-banner,
.farklı-konum-banner+.ozel-uni-banner {
    border-radius: 0;
    margin-top: -12px;
}


/* Program Details Grid */
.program-details {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 4px;
    background: white;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* Doluluk durumu renkleri */
.detail-value.doldu {
    color: #c62828;
    font-weight: 700;
}

.detail-value.bos {
    color: #2e7d32;
    font-weight: 700;
}

/* Veri yılı stili */
.detail-value.veri-yili {
    color: #1A4D3E;
    font-weight: 800;
}

.detail-label {
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.detail-value.score {
    color: #1A4D3E;
}

.detail-value.free {
    color: #388e3c;
}

.detail-value small {
    font-size: 10px;
    font-weight: 500;
    color: #888;
    display: block;
}

/* Responsive */
@media (max-width: 992px) {
    .departments-grid {
        grid-template-columns: 1fr;
    }

    .program-details {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {
    .program-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .faculty-accordion-header {
        padding: 16px;
    }

    .faculty-title {
        font-size: 16px;
    }

    .departments-grid {
        padding: 12px;
    }

    .dept-card-visual {
        height: 168px;
    }

    .dept-card-visual .gallery-fav-btn {
        width: 40px;
        height: 40px;
    }

    .dept-card-visual .gallery-km-val {
        font-size: 0.85rem;
    }

    .dept-card-visual .gallery-dk-tile-val {
        font-size: 0.75rem;
    }
}

/* Mobil / dar ekran: tablo düzeni aynı kalır, taşan sütunlar yatay kaydırılır */
@media (max-width: 992px) {
    #rankings.tab-content.active {
        display: block;
        width: 100%;
        min-width: 0;
    }

    #rankings .content-card {
        padding: 1.25rem 0.85rem;
        overflow: visible;
        max-width: 100%;
    }

    #rankings .faculties-section,
    #rankings .faculty-accordion,
    #rankings .programs-list {
        min-width: 0;
        max-width: 100%;
    }

    #rankings .departments-grid {
        grid-template-columns: 1fr;
    }

    #rankings .dept-card {
        overflow: visible;
        max-width: 100%;
    }

    #rankings .program-group {
        overflow: visible;
        max-width: 100%;
        min-width: 0;
    }

    #rankings .years-table th,
    #rankings .years-table td {
        padding: 8px 4px;
        font-size: 11px;
    }

    #rankings .years-table th {
        font-size: 9px;
    }
}

/* Çok dar ekran: tablo sığmazsa yatay kaydır; tooltip için alt boşluk */
@media (max-width: 480px) {
    #rankings .years-table-scroll {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 5rem;
    }

    #rankings .years-table-scroll::-webkit-scrollbar {
        height: 6px;
    }

    #rankings .years-table-scroll::-webkit-scrollbar-thumb {
        background: rgba(26, 77, 62, 0.35);
        border-radius: 4px;
    }

    #rankings .years-table {
        table-layout: auto;
        width: max-content;
        min-width: 100%;
    }

    #rankings .years-table th,
    #rankings .years-table td {
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    #rankings .years-table .score-cell {
        white-space: nowrap;
        word-break: normal;
    }
}