/**
 * IFPS Code Search — Stil Dosyası
 * Abbreviations eklentisiyle uyumlu renk paleti
 */

/* ── Container ──────────────────────────────────────────────────────────────── */

.ifps-search-container {
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    position: relative;
}

.ifps-search-container *,
.ifps-search-container *::before,
.ifps-search-container *::after {
    box-sizing: border-box;
}

/* ── Quick Reference ────────────────────────────────────────────────────────── */

.ifps-quick-ref {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ifps-quick-ref-label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.ifps-qr-btn {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f4f8;
    border: 1px solid #c5d0de;
    border-radius: 4px;
    color: #0073aa;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    text-transform: none !important;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}

.ifps-qr-btn:hover {
    background: #dce8f5;
    border-color: #0073aa;
}

/* ── Arama çubuğu ───────────────────────────────────────────────────────────── */

.ifps-search-bar {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 30px;
}

.ifps-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s;
    min-width: 0;
}

.ifps-input:focus {
    border-color: #0073aa;
}

.ifps-btn {
    padding: 12px 18px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    text-transform: none !important;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ifps-btn-primary {
    min-width: 120px;
    background: #0073aa;
    color: #fff;
}

.ifps-btn-primary:hover {
    background: #005a87;
}

.ifps-btn-primary:active {
    transform: translateY(1px);
}

.ifps-btn-secondary {
    background: #f0f4f8;
    color: #0073aa;
    border: 1px solid #c5d0de;
}

.ifps-btn-secondary:hover {
    background: #dce8f5;
    border-color: #0073aa;
}

/* ── Başlangıç / intro ──────────────────────────────────────────────────────── */

.ifps-intro {
    padding: 60px 20px;
    text-align: center;
}

.ifps-placeholder-text {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.ifps-placeholder-text span {
    font-size: 16px;
    color: #666;
}

.ifps-edition {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    margin-top: 16px;
    text-align: center;
}

.ifps-edition strong {
    color: #333;
}

/* ── Sonuç kartları ─────────────────────────────────────────────────────────── */

.ifps-results {
    margin-top: 4px;
}

.ifps-result-count {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.ifps-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    background: #fff;
}

.ifps-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.ifps-card-code {
    font-size: 18px;
    font-weight: 700;
    color: #0073aa;
}

.ifps-card-class-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: #e8f0fb;
    color: #0073aa;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #c5d0de;
}

/* ── Hata mesajı (özel alan) ─────────────────────────────────────────────────── */

.ifps-card-message {
    font-size: 16px;
    font-weight: 500;
    color: #222;
    line-height: 1.5;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    word-break: break-word;
}

/* ── Bölümler ───────────────────────────────────────────────────────────────── */

.ifps-section {
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid #f0f0f0;
}

/* Mesaj varsa: mesajın hemen ardındaki section'da border-top olmasın */
.ifps-card-message + .ifps-section {
    border-top: none;
    padding-top: 0;
}

/* Mesaj yoksa: header'ın hemen ardındaki section'da border-top olmasın */
.ifps-card-header + .ifps-section {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.ifps-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #0073aa;
    margin-bottom: 5px;
    text-decoration: underline;
}

.ifps-section-body {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

.ifps-section-body img.ifps-inline-image {
    display: block;
    max-width: 100%;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* is_ignorable badge */
.ifps-ignorable-yes {
    display: inline-block;
    padding: 2px 8px;
    background: #e6f4ea;
    color: #1e7e34;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}

.ifps-ignorable-no {
    display: inline-block;
    padding: 2px 8px;
    background: #fdecea;
    color: #b71c1c;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}

/* ── Error List Panel ───────────────────────────────────────────────────────── */

.ifps-list-panel {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    margin-top: 8px;
}

.ifps-list-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.ifps-filters-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ifps-filters-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.ifps-class-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ifps-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border: 1px solid #c5d0de;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    background: #fff;
    color: #666;
    text-transform: none !important;
    transition: background 0.15s, border-color 0.15s;
}

.ifps-filter-chip::before {
    content: "☐";
    font-size: 16px;
    line-height: 1;
    color: #aaa;
}

.ifps-filter-chip.active {
    background: #f0f6ff;
    border-color: #0073aa;
    color: #0073aa;
}

.ifps-filter-chip.active::before {
    content: "☑";
    font-size: 16px;
    color: #0073aa;
}

.ifps-filter-chip:hover:not(.active) {
    background: #f5f8fc;
    border-color: #8ab4d4;
}

.ifps-list-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.ifps-list-close:hover {
    color: #333;
}

.ifps-list-body {
    max-height: 600px;
    overflow-y: auto;
}

.ifps-list-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: #f5f7fa;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
}

.ifps-list-col-code {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    min-width: 90px;
}

.ifps-list-col-preview {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

.ifps-list-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.ifps-list-item:hover {
    background: #f0f6ff;
}

.ifps-list-item-code {
    font-weight: 600;
    color: #0073aa;
    font-size: 13px;
    flex-shrink: 0;
    min-width: 90px;
}

.ifps-list-item-preview {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.ifps-list-empty {
    padding: 20px 14px;
    color: #888;
    font-size: 13px;
    text-align: center;
}

/* ── Hata / boş / yükleniyor durumu ────────────────────────────────────────── */

.ifps-no-result {
    padding: 40px 20px;
    text-align: center;
    font-size: 16px;
    color: #666;
}

.ifps-loading {
    padding: 40px 20px;
    text-align: center;
    font-size: 16px;
    color: #0073aa;
    font-weight: 500;
}

/* ── PDF Modal ──────────────────────────────────────────────────────────────── */

.ifps-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.ifps-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

.ifps-modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.ifps-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #0073aa;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

.ifps-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.85;
}

.ifps-modal-close:hover {
    opacity: 1;
}

.ifps-modal-box iframe {
    flex: 1;
    width: 100%;
    display: block;
}

/* ── Hata / boş / yükleniyor durumu ────────────────────────────────────────── */

.ifps-no-result {
    padding: 40px 20px;
    text-align: center;
    font-size: 16px;
    color: #666;
}

.ifps-loading {
    padding: 40px 20px;
    text-align: center;
    font-size: 16px;
    color: #0073aa;
    font-weight: 500;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .ifps-search-bar {
        flex-wrap: wrap;
    }

    .ifps-input {
        flex-basis: 100%;
    }

    .ifps-btn {
        flex: 1;
    }

    .ifps-modal-box {
        width: 97%;
        height: 90vh;
    }

    .ifps-card-header {
        flex-wrap: wrap;
    }
}
