/* ============================================================
   Ansiklopedi Plugin — Frontend Stilleri
   ============================================================ */

:root {
    --ansk-hero-from:   #0a7f6c;
    --ansk-hero-to:     #044d3e;
    --ansk-hero-text:   #ffffff;
    --ansk-accent:      #34d399;
    --ansk-radius:      12px;
    --ansk-shadow:      0 4px 24px rgba(0,0,0,.10);
}

/* ── Hero Üst Alan ── */
.ansk-hero {
    background: linear-gradient(135deg, var(--ansk-hero-from), var(--ansk-hero-to));
    color: var(--ansk-hero-text);
    padding: 70px 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ansk-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 60% 40%, rgba(255,255,255,.07) 0%, transparent 70%);
    pointer-events: none;
}

.ansk-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.2;
}

.ansk-hero-subtitle {
    font-size: clamp(.95rem, 2vw, 1.15rem);
    opacity: .85;
    font-style: italic;
    margin: 0;
}

/* ── Arama Bölümü ── */
.ansk-search-section {
    padding: 48px 20px 40px;
    text-align: center;
}

.ansk-search-headline {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a202c;
}

.ansk-search-headline em {
    color: var(--ansk-accent);
    font-style: italic;
}

.ansk-search-lead {
    color: #4a5568;
    margin: 0 0 24px;
    font-size: .95rem;
}

.ansk-search-form {
    display: flex;
    max-width: 640px;
    margin: 0 auto 28px;
    border-radius: var(--ansk-radius);
    box-shadow: var(--ansk-shadow);
    overflow: hidden;
}

.ansk-search-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: var(--ansk-radius) 0 0 var(--ansk-radius);
    outline: none;
    transition: border-color .2s;
}

.ansk-search-input:focus {
    border-color: var(--ansk-hero-from);
}

.ansk-search-btn {
    padding: 14px 28px;
    background: var(--ansk-hero-from);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 var(--ansk-radius) var(--ansk-radius) 0;
    transition: background .2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ansk-search-btn:hover {
    background: var(--ansk-hero-to);
}

/* ── Konu Önerileri ── */
.ansk-topics-label {
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #718096;
    margin-bottom: 12px;
}

.ansk-topics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.ansk-topic-btn {
    padding: 7px 16px;
    border: 1.5px solid #cbd5e0;
    border-radius: 999px;
    background: transparent;
    font-size: .87rem;
    cursor: pointer;
    color: #2d3748;
    transition: border-color .2s, background .2s, color .2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ansk-topic-btn:hover {
    border-color: var(--ansk-hero-from);
    background: var(--ansk-hero-from);
    color: #fff;
}

/* ── Yükleniyor ── */
.ansk-loading {
    display: none;
    text-align: center;
    padding: 30px;
    color: #718096;
}

.ansk-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--ansk-hero-from);
    border-radius: 50%;
    animation: ansk-spin .8s linear infinite;
    margin-bottom: 10px;
}

@keyframes ansk-spin { to { transform: rotate(360deg); } }

/* ── Sonuç Listesi ── */
.ansk-results {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.ansk-results-title {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.ansk-results-title strong {
    color: var(--ansk-hero-from);
}

.ansk-result-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--ansk-radius);
    padding: 20px 24px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: box-shadow .2s, border-color .2s;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ansk-result-card:hover {
    box-shadow: var(--ansk-shadow);
    border-color: var(--ansk-hero-from);
}

.ansk-result-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--ansk-hero-from), var(--ansk-hero-to));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.ansk-result-body { flex: 1; }

.ansk-result-card h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--ansk-hero-from);
}

.ansk-result-card p {
    margin: 0;
    font-size: .88rem;
    color: #4a5568;
    line-height: 1.6;
}

.ansk-result-arrow {
    color: #cbd5e0;
    font-size: 1.2rem;
    align-self: center;
}

/* ── Makale Modal ── */
.ansk-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ansk-modal-overlay.active {
    display: flex;
}

.ansk-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 760px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 36px 40px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.ansk-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #718096;
    line-height: 1;
}

.ansk-modal-close:hover { color: #2d3748; }

.ansk-modal-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.ansk-modal-header h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    color: var(--ansk-hero-from);
}

.ansk-modal-thumbnail {
    float: right;
    max-width: 200px;
    border-radius: 8px;
    margin: 0 0 16px 20px;
    border: 1px solid #e2e8f0;
}

.ansk-modal-extract {
    font-size: .95rem;
    line-height: 1.75;
    color: #2d3748;
}

.ansk-modal-extract p { margin: 0 0 14px; }

.ansk-modal-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.ansk-modal-credit {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: #718096;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 14px;
}

/* ── Hata Mesajı ── */
.ansk-error {
    display: none;
    background: #fff5f5;
    border: 1px solid #fc8181;
    color: #c53030;
    border-radius: var(--ansk-radius);
    padding: 14px 18px;
    max-width: 640px;
    margin: 0 auto 20px;
    text-align: center;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .ansk-modal { padding: 24px 18px; }
    .ansk-modal-thumbnail { float: none; max-width: 100%; margin: 0 0 12px; }
    .ansk-search-form { flex-direction: column; border-radius: var(--ansk-radius); }
    .ansk-search-input { border-right: 2px solid #e2e8f0; border-radius: var(--ansk-radius) var(--ansk-radius) 0 0; }
    .ansk-search-btn { border-radius: 0 0 var(--ansk-radius) var(--ansk-radius); justify-content: center; }
}
