/* ════════════════════════════════════════════════════════
   Üniversite Taban Puanları — v2 Sıfırdan Tasarım
   %100 Kırılmaz Responsive — Asla Taşma Yapmaz
   ════════════════════════════════════════════════════════ */

/* ─── DEĞİŞKENLER ─── */
:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --accent: #2563eb;
    --dark: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f1f5f9;
    --white: #ffffff;
    --green: #10b981;
    --yellow: #f59e0b;
    --red: #ef4444;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.05);
    --shadow-hover: 0 8px 30px rgba(0,0,0,.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ─── GLOBAL RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; display: block; }

/* ─── NAVBAR ─── */
#mainNavbar {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    box-shadow: 0 2px 16px rgba(0,0,0,.25);
    padding: .5rem 0;
    z-index: 1050;
}
#mainNavbar .navbar-brand { font-size: 1.15rem; letter-spacing: -.01em; }
#mainNavbar .navbar-brand i { color: var(--primary-light); }
#mainNavbar .nav-link {
    color: rgba(255,255,255,.8);
    font-weight: 500;
    font-size: .9rem;
    padding: .4rem .8rem;
    border-radius: 8px;
    transition: .2s;
}
#mainNavbar .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ══════════════════════════
   HERO
   ══════════════════════════ */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%);
    padding: 3.5rem 0 4.5rem;
    position: relative;
    overflow: hidden;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--bg));
}
.hero-title {
    font-size: clamp(1.5rem, 5vw, 2.6rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    word-break: break-word;
}
.hero-title .accent {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    color: rgba(255,255,255,.65);
    font-size: clamp(.88rem, 2vw, 1.1rem);
    max-width: 580px;
}

/* ─── ARAMA ─── */
.search-wrapper { position: relative; max-width: 640px; margin: 0 auto; }
.search-input {
    width: 100%;
    padding: .9rem 1.2rem .9rem 3rem;
    font-size: 1rem;
    border: 2px solid rgba(255,255,255,.12);
    border-radius: 50px;
    background: rgba(255,255,255,.07);
    color: #fff;
    outline: none;
    transition: .25s;
}
.search-input::placeholder { color: rgba(255,255,255,.4); }
.search-input:focus { border-color: var(--primary-light); background: rgba(255,255,255,.1); box-shadow: 0 0 0 4px rgba(59,130,246,.2); }
.search-icon {
    position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,.45); font-size: 1.1rem; pointer-events: none;
}

/* Dropdown */
.search-results-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-hover);
    border: 1px solid var(--border); max-height: 350px; overflow-y: auto;
    z-index: 1060; display: none;
}
.search-results-dropdown.active { display: block; animation: fadeSlide .2s ease; }
.search-result-item {
    display: flex; align-items: center; padding: .7rem 1rem;
    border-bottom: 1px solid var(--border); transition: .15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg); }
.search-result-item .result-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: #eff6ff; display: flex; align-items: center; justify-content: center;
    margin-right: .7rem; flex-shrink: 0; color: var(--primary); font-size: .9rem;
}
.search-result-item .result-text { min-width: 0; flex: 1; }
.search-result-item .result-title { font-weight: 600; font-size: .88rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-item .result-meta { font-size: .76rem; color: var(--muted); }

/* ─── PUAN BUTONLARI ─── */
.puan-btn-group { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.puan-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .5rem 1.2rem; border-radius: 50px;
    border: 2px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.06); color: #fff;
    font-weight: 600; font-size: .85rem; transition: .25s;
}
.puan-btn:hover { background: rgba(255,255,255,.15); border-color: var(--primary-light); color: #fff; transform: translateY(-2px); }

/* ══════════════════════════
   KARTLAR
   ══════════════════════════ */
.card-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
    transition: .25s;
    height: 100%;
    word-break: break-word;
    overflow: hidden;
}
.card-box:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card-box .card-badge {
    display: inline-block; padding: .2rem .6rem; border-radius: 50px;
    font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badge-devlet { background: #dbeafe; color: #1e40af; }
.badge-vakif  { background: #fef3c7; color: #92400e; }
.badge-kibris { background: #d1fae5; color: #065f46; }

.card-box .card-title { font-size: 1.05rem; font-weight: 700; color: var(--dark); margin: .6rem 0 .4rem; line-height: 1.3; }
.card-box .card-title a { color: inherit; }
.card-box .card-title a:hover { color: var(--primary-light); }
.card-box .card-info { font-size: .82rem; color: var(--muted); }
.card-box .card-info i { width: 16px; color: var(--primary-light); }

/* ─── STAT KARTLARI ─── */
.stat-card {
    background: var(--white); border-radius: var(--radius);
    padding: 1.1rem; border: 1px solid var(--border);
    text-align: center; box-shadow: var(--shadow);
}
.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem; margin-bottom: .5rem;
}
.stat-card .stat-value { font-size: 1.4rem; font-weight: 800; color: var(--dark); line-height: 1.2; }
.stat-card .stat-label { font-size: .78rem; color: var(--muted); font-weight: 500; }

/* ══════════════════════════
   SAYFA HEADER (detay sayfaları)
   ══════════════════════════ */
.page-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%);
    padding: 2.5rem 0;
    position: relative;
    overflow: hidden;
}
.page-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 50px;
    background: linear-gradient(transparent, var(--bg));
}
.page-header h1 {
    color: #fff;
    font-weight: 800;
    font-size: clamp(1.2rem, 4vw, 1.85rem);
    line-height: 1.3;
    word-break: break-word;
}
.page-header .lead {
    color: rgba(255,255,255,.65);
    font-size: clamp(.8rem, 2vw, .95rem);
    word-break: break-word;
}

/* ══════════════════════════
   BİLGİ KUTUSU (Sidebar / Detay)
   ══════════════════════════ */
.info-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    word-break: break-word;
}
.info-box .info-item {
    display: flex; align-items: center;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
    gap: .7rem;
}
.info-box .info-item:last-child { border-bottom: none; }
.info-box .info-icon {
    width: 34px; height: 34px; border-radius: 8px;
    background: #eff6ff; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--primary); font-size: .9rem;
}
.info-box .info-label { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.info-box .info-value { font-weight: 700; color: var(--dark); font-size: .95rem; }

/* Künye */
.kunye-content { overflow: hidden; word-break: break-word; }
.kunye-content img { max-width: 100%; height: auto; }
.kunye-content table { width: 100%; display: block; overflow-x: auto; }

/* Fakülte listesi */
.fak-list a {
    display: flex; align-items: center; gap: .4rem;
    padding: .45rem 0; font-size: .85rem; color: var(--text);
    border-bottom: 1px solid rgba(0,0,0,.04); transition: .15s;
}
.fak-list a:last-child { border-bottom: none; }
.fak-list a:hover { color: var(--primary-light); padding-left: 4px; }
.fak-list a i { color: var(--primary-light); flex-shrink: 0; font-size: .75rem; }

/* ─── SEKTİON BAŞLIK ─── */
.section-title {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 800; color: var(--dark);
    padding-bottom: .6rem; margin-bottom: 1.2rem;
    position: relative; word-break: break-word;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 45px; height: 3px; border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ══════════════════════════
   VERİ TABLOLARI — MASAÜSTÜ
   ══════════════════════════ */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: var(--white);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    min-width: 600px;
}
.data-table thead { background: linear-gradient(135deg, #1e293b, #334155); }
.data-table thead th {
    color: #fff; font-weight: 600; font-size: .75rem;
    text-transform: uppercase; letter-spacing: .04em;
    padding: .7rem .6rem; border: none; white-space: nowrap;
}
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: .15s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody td {
    padding: .6rem; font-size: .83rem; color: var(--text); vertical-align: middle;
}
.data-table tbody td a { font-weight: 600; white-space: normal; word-break: break-word; }

/* Puan badge */
.puan-badge {
    display: inline-block; padding: .2rem .5rem; border-radius: 5px;
    font-weight: 700; font-size: .8rem; white-space: nowrap;
}
.puan-badge.high { background: #dcfce7; color: #166534; }
.puan-badge.mid  { background: #fef3c7; color: #92400e; }
.puan-badge.low  { background: #fee2e2; color: #991b1b; }

/* ══════════════════════════════════
   MOBİL: TABLO → KART DÖNÜŞÜMÜ
   768px altında her satır bağımsız kart olur.
   Asla yatay kaydırma olmaz.
   ══════════════════════════════════ */
@media (max-width: 768px) {
    .table-container {
        overflow-x: visible;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .data-table {
        min-width: 0;
        white-space: normal;
    }

    .data-table thead {
        display: none !important;
    }

    .data-table tbody,
    .data-table tbody tr,
    .data-table tbody td {
        display: block;
        width: 100% !important;
    }

    .data-table tbody tr {
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: .8rem;
        box-shadow: var(--shadow);
        overflow: hidden;
    }

    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .55rem .9rem;
        border-bottom: 1px solid rgba(0,0,0,.03);
        text-align: right;
        font-size: .83rem;
        white-space: normal;
        word-break: break-word;
    }

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

    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--dark);
        text-align: left;
        flex-shrink: 0;
        margin-right: .8rem;
        font-size: .75rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        max-width: 42%;
        white-space: normal;
    }

    .data-table tbody td:first-child {
        background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
        font-weight: 700;
        font-size: .85rem;
        padding: .7rem .9rem;
        border-bottom: 2px solid var(--border);
    }

    .data-table tbody td:first-child a {
        word-break: break-word;
        white-space: normal;
    }
}

/* ══════════════════════════
   FİLTRE PANELİ
   ══════════════════════════ */
.filter-panel {
    background: var(--white); border-radius: var(--radius);
    padding: 1.5rem; border: 1px solid var(--border);
    box-shadow: var(--shadow); position: sticky; top: 75px;
}
.filter-panel .form-label { font-weight: 600; font-size: .82rem; color: var(--dark); margin-bottom: .3rem; }
.filter-panel .form-select,
.filter-panel .form-control {
    border-radius: 8px; border: 1.5px solid var(--border);
    padding: .55rem .75rem; font-size: .88rem; transition: .2s;
}
.filter-panel .form-select:focus,
.filter-panel .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ─── BUTONLAR ─── */
.btn-primary {
    background: var(--primary-light); border-color: var(--primary-light);
    border-radius: 8px; font-weight: 600; transition: .2s;
}
.btn-primary:hover {
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.btn-outline-primary {
    color: var(--primary-light); border-color: var(--primary-light);
    border-radius: 8px; font-weight: 600;
}
.btn-outline-primary:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }

/* ─── SAYFALAMA ─── */
.pagination .page-link {
    border-radius: 8px; margin: 0 2px; border: 1px solid var(--border);
    color: var(--text); font-weight: 500; font-size: .88rem;
    padding: .4rem .75rem; transition: .2s;
}
.pagination .page-link:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─── FOOTER ─── */
.site-footer { background: var(--dark); color: rgba(255,255,255,.75); }
.site-footer .footer-title { color: #fff; font-weight: 700; font-size: 1.1rem; }
.site-footer .footer-subtitle { color: #fff; font-weight: 600; font-size: .92rem; }
.site-footer .footer-links li { margin-bottom: .35rem; }
.site-footer .footer-links a { color: rgba(255,255,255,.55); font-size: .85rem; transition: .15s; }
.site-footer .footer-links a:hover { color: var(--primary-light); padding-left: 3px; }
.text-light-muted { color: rgba(255,255,255,.45) !important; }
.footer-bottom { border-color: rgba(255,255,255,.08) !important; }

/* ─── SPINNER ─── */
.loading-spinner {
    display: inline-block; width: 22px; height: 22px;
    border: 3px solid var(--border); border-top-color: var(--primary-light);
    border-radius: 50%; animation: spin .6s linear infinite;
}

/* ─── ANİMASYONLAR ─── */
@keyframes fadeSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-in-up { animation: fadeUp .4s ease forwards; }

/* ══════════════════════════
   RESPONSIVE AYARLARI
   ══════════════════════════ */
@media (max-width: 991px) {
    .filter-panel { position: static; }
}

@media (max-width: 768px) {
    .hero-section { padding: 2.5rem 0 3.5rem; }
    .page-header { padding: 1.8rem 0; }
    .info-box { padding: 1.1rem; }
    .stat-card { padding: .9rem; }
    .stat-card .stat-value { font-size: 1.2rem; }
    .breadcrumb { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .breadcrumb-item { flex-shrink: 0; }
}

@media (max-width: 576px) {
    .container { padding-left: 10px; padding-right: 10px; }
    .puan-btn { padding: .4rem .7rem; font-size: .76rem; }
    .search-input { padding: .8rem .9rem .8rem 2.6rem; font-size: .9rem; }
    .search-icon { left: .9rem; }
    .stat-card .stat-value { font-size: 1.05rem; }
    .card-box { padding: 1.1rem; }
    .uni-card { padding: 1.1rem; }
    .info-box .info-icon { width: 30px; height: 30px; font-size: .8rem; }
}

/* ─── ADMIN ─── */
.admin-sidebar {
    background: var(--dark); min-height: 100vh; padding: 1.3rem;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,.65); padding: .5rem .8rem;
    border-radius: 8px; margin-bottom: .2rem; font-size: .88rem; transition: .15s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-content { padding: 1.5rem; }

/* ─── YARDIMCI ─── */
.no-overflow { overflow-x: hidden !important; max-width: 100% !important; }
.uni-card { /* alias for card-box */
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
    transition: .25s;
    height: 100%;
    word-break: break-word;
    overflow: hidden;
    position: relative;
}
.uni-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0; transition: .25s;
}
.uni-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.uni-card:hover::before { opacity: 1; }
.uni-card .card-badge { display: inline-block; padding: .2rem .6rem; border-radius: 50px; font-size: .7rem; font-weight: 600; text-transform: uppercase; }
.uni-card .card-title { font-size: 1.05rem; font-weight: 700; color: var(--dark); margin: .6rem 0 .4rem; line-height: 1.3; }
.uni-card .card-title a { color: inherit; }
.uni-card .card-title a:hover { color: var(--primary-light); }
.uni-card .card-info { font-size: .82rem; color: var(--muted); }
.uni-card .card-info i { width: 16px; color: var(--primary-light); }

/* ─── ÖNE ÇIKAN ÜNİVERSİTE TASARIMI ─── */
.uni-card.featured {
    border: 2px solid #f59e0b !important;
    background: linear-gradient(180deg, #fffcf5 0%, #ffffff 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15) !important;
}
.uni-card.featured::before {
    background: linear-gradient(90deg, #f59e0b, #d97706) !important;
    opacity: 1 !important;
    height: 4px !important;
}
.uni-card.featured:hover {
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.3) !important;
}
.uni-card.featured .featured-badge {
    position: absolute; top: 1.4rem; right: 1.4rem;
    background: #f59e0b; color: #fff;
    font-size: .65rem; font-weight: 800;
    padding: .2rem .6rem; border-radius: 50px;
    letter-spacing: .05em; text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    z-index: 5;
}

/* ─── REKLAM ALANI KUTULARI ─── */
.ad-banner {
    width: 100%;
    margin: 1.5rem 0;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
}
.ad-banner::before {
    content: 'REKLAM ALANI (728x90)';
    font-size: .72rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: .08em;
    margin-bottom: .2rem;
}
.ad-banner::after {
    content: 'Reklam kodunuzu (AdSense vb.) buraya yerleştirebilirsiniz.';
    font-size: .68rem;
    color: #94a3b8;
}

.ad-sidebar {
    width: 100%;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ad-sidebar::before {
    content: 'REKLAM ALANI (300x250)';
    font-size: .72rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: .08em;
    margin-bottom: .2rem;
}
.ad-sidebar::after {
    content: 'Reklam kodunuzu buraya yerleştirebilirsiniz.';
    font-size: .68rem;
    color: #94a3b8;
}

@media (max-width: 576px) {
    .ad-banner::before { content: 'REKLAM ALANI (320x100)'; }
    .ad-banner { min-height: 90px; padding: 1rem; }
    .uni-card.featured .featured-badge { top: 1.1rem; right: 1.1rem; }
}
