/* ==========================================================================
   KaguTech Systems - Yazılım & Tasarım Sözlüğü Sayfa Stilleri
   Mevcut style.css üzerine eklenen bileşenler
   ========================================================================== */

/* --- Page Hero --- */
.glossary-hero {
    padding: 8rem 0 2.5rem;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.glossary-hero-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(15, 23, 42, 0) 70%);
    z-index: 0;
}

.glossary-hero .container {
    position: relative;
    z-index: 1;
}

.glossary-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.glossary-hero .hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
}

/* --- Stats Bar --- */
.glossary-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin: 2rem 0 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-light);
}

.glossary-stat {
    text-align: center;
}

.glossary-stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glossary-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --- Arama Bölümü (İnce Sticky Bar) --- */
.glossary-controls {
    padding: 0.85rem 0;
    position: sticky;
    /* Değer JS tarafından header yüksekliği ölçülerek güncellenir (sozluk.js) */
    top: var(--glossary-header-h, 82px);
    z-index: 50;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow 0.3s ease;
}

.glossary-controls .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.glossary-controls.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 560px;
    margin: 0;
}

.search-wrapper input {
    width: 100%;
    padding: 0.7rem 1.25rem 0.7rem 2.85rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: var(--glass-blur);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.search-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrapper .search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.search-wrapper .search-clear.visible {
    display: flex;
}

.search-wrapper .search-clear:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.search-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-count:empty {
    display: none;
}

.search-count span {
    color: #60a5fa;
    font-weight: 600;
}

/* --- Sözlük Yerleşimi (Sol Panel + İçerik) --- */
.glossary-layout {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.glossary-main {
    min-width: 0;
}

/* --- Alfabe Navigasyonu (Sol Dikey Panel) --- */
.alphabet-sidebar {
    position: sticky;
    /* header + arama barı yüksekliği (JS ile ölçülür) + nefes payı */
    top: calc(var(--glossary-sticky-h, 155px) + 14px);
}

.alphabet-sidebar-inner {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 0.85rem 0.7rem;
    display: flex;
    flex-direction: column;
    /* Panel hiçbir zaman ekranı aşmasın; taşarsa kendi içinde kayar */
    max-height: calc(100vh - var(--glossary-sticky-h, 155px) - 45px);
}

.alphabet-sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0 0.15rem 0.65rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.alphabet-sidebar-title i {
    color: var(--primary);
}

.alphabet-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.alphabet-nav::-webkit-scrollbar {
    width: 4px;
}

.alphabet-nav::-webkit-scrollbar-track {
    background: transparent;
}

.alphabet-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.alpha-btn {
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alpha-btn-all {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.alpha-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

.alpha-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.alpha-btn.disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

/* --- Harf Grubu Başlıkları --- */
.letter-group {
    margin-bottom: 2.5rem;
}

.letter-heading {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(59, 130, 246, 0.15);
    display: inline-block;
    scroll-margin-top: 170px;
}

/* --- Terim Kartları --- */
.term-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.term-card.animate-in {
    animation: termFadeIn 0.5s ease forwards;
}

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

.term-card:hover {
    border-color: rgba(59, 130, 246, 0.25);
    background: rgba(30, 41, 59, 0.6);
}

.term-card.hidden {
    display: none;
}

.term-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.term-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    flex-shrink: 0;
}

.term-icon i {
    width: 22px;
    height: 22px;
}

.term-title-area {
    flex: 1;
}

.term-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-main);
}

.term-english {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.term-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.term-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.term-badge.gelistirme {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.term-badge.tasarim {
    background: rgba(139, 92, 246, 0.1);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.term-badge.altyapi {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.term-badge.guvenlik {
    background: rgba(251, 113, 133, 0.1);
    color: #fb7185;
    border: 1px solid rgba(251, 113, 133, 0.2);
}

.term-badge.seo-badge {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.term-badge.veritabani {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.term-body {
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
}

.term-body p {
    margin-bottom: 0.75rem;
}

.term-body p:last-child {
    margin-bottom: 0;
}

/* --- Boş Arama Sonucu --- */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    display: none;
}

.no-results.visible {
    display: block;
}

.no-results-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.no-results h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- CTA Section --- */
.glossary-cta {
    padding: 4rem 0;
    text-align: center;
}

.glossary-cta-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 3.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.glossary-cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.glossary-cta-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.glossary-cta-card p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 550px;
    margin: 0 auto 2rem;
}

/* --- Glossary Content Section --- */
.glossary-content {
    padding: 2.5rem 0 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .glossary-hero h1 {
        font-size: 2.2rem;
    }

    .glossary-hero {
        padding: 7rem 0 2rem;
    }

    .glossary-controls .container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-wrapper {
        width: 100%;
        max-width: none;
    }

    /* Mobilde sol panel yerine içeriğin üstünde yatay şerit */
    .glossary-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .alphabet-sidebar {
        position: static;
    }

    .alphabet-sidebar-inner {
        padding: 0.75rem;
        max-height: none;
    }

    .alphabet-nav {
        grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
        overflow-y: visible;
    }

    .alpha-btn {
        height: 32px;
        font-size: 0.75rem;
        border-radius: 8px;
    }

    .alpha-btn-all {
        grid-column: 1 / -1;
    }

    .term-card {
        padding: 1.5rem;
    }

    .term-header {
        flex-direction: column;
    }

    .term-title {
        font-size: 1.15rem;
    }

    .glossary-stats {
        gap: 2rem;
    }

    .letter-heading {
        font-size: 2rem;
        scroll-margin-top: 140px;
    }

    .search-wrapper input {
        font-size: 0.9rem;
    }
}
