﻿:root {
    --black: #000;
    --white: #fff;
    --text: #333;
    --muted: #E0E0E0;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.15);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 12px 26px rgba(0,0,0,0.16);
    --primary: #4f8cff;
    --primary-strong: #1f73ff;
    --amber: #f6b73c;
    --amber-strong: #f59e0b;
    --danger: #d32f2f;
    --yf-h: 64px;
}

* {
    box-sizing: border-box;
}

body {
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------- SSS Header --------- */
.sss-header {
    width: 100%;
    height: 46px;
    background-color: var(--black);
    display: flex;
    align-items: center;
    padding-left: 16px;
    position: relative;
    z-index: 10;
}

    .sss-header h4 {
        color: var(--white);
        font-size: 16px;
        font-weight: 600;
        margin: 0;
    }

/* --------- SSS Search --------- */
.sss-search-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 420px;
    height: 36px;
    background: var(--white);
    border-radius: 5px;
    margin: 16px auto;
    box-shadow: var(--shadow-sm);
    padding: 0 10px;
    position: relative;
}

.sss-search-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    opacity: .7;
}

.sss-search-form {
    flex: 1;
}

.sss-search-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
}

/* --------- SSS List --------- */
.sss-question-list {
    padding-bottom: 80px;
}

.sss-question-card {
    width: 90%;
    max-width: 420px;
}

.sss-question-row {
    width: 100%;
    max-width: 420px;
    cursor: pointer;
    padding: 10px 0;
}

.sss-question-title {
    font-size: 16px;
    font-weight: 500;
    color: #000;
    margin: 0;
    line-height: 24px;
}

.sss-question-divider {
    width: 420px;
    height: 2px;
    background-color: var(--muted);
    margin: 4px 0 8px;
}

/* --------- SSS Footer (liste) --------- */
.sss-footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.sss-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 180px;
    height: 52px;
    font-size: 16px;
    color: var(--white);
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

    .sss-btn img {
        width: 18px;
        height: 18px;
    }

.sss-add-btn {
    background-color: #5ca8ff;
}

.sss-delete-btn {
    background-color: var(--danger);
}

@media (max-width:480px) {
    .sss-footer {
        max-width: 95%;
        gap: 12px;
    }

    .sss-btn {
        width: 150px;
        height: 42px;
        font-size: 14px;
    }
}

/* --------- Soru Başlık --------- */
.soru-baslik {
    width: 100%;
    height: 46px;
    background-color: var(--black);
    color: var(--white);
    font-size: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

@media (max-width:480px) {
    .soru-baslik {
        width: 100%;
        max-width: 100%;
        font-size: 18px;
        border-radius: 0;
    }
}

/* --------- Cevap Kartı (RICH TEXT hazır) --------- */
.soru-cevap {
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 16px;
    background-color: var(--white);
    max-width: 420px;
    width: 100%;
    margin: 12px auto;
    box-shadow: var(--shadow-md);
    line-height: 1.7;
    font-size: 16px;
    word-wrap: break-word;
    color: var(--text);
}
    /* Rich text tipografi */
    .soru-cevap .rt-content {
        color: #0f172a;
        line-height: 1.75;
    }

        .soru-cevap .rt-content p {
            margin: 0 0 12px;
        }

        .soru-cevap .rt-content h1,
        .soru-cevap .rt-content h2,
        .soru-cevap .rt-content h3 {
            margin: 10px 0 8px;
            line-height: 1.3;
            font-weight: 700;
        }

        .soru-cevap .rt-content h1 {
            font-size: 22px;
        }

        .soru-cevap .rt-content h2 {
            font-size: 20px;
        }

        .soru-cevap .rt-content h3 {
            font-size: 18px;
        }

        .soru-cevap .rt-content ul,
        .soru-cevap .rt-content ol {
            margin: 8px 0 12px;
            padding-left: 1.25rem;
        }

        .soru-cevap .rt-content li {
            margin: 6px 0;
        }

        .soru-cevap .rt-content ul li::marker {
            color: var(--primary-strong);
        }

        .soru-cevap .rt-content a,
        .soru-cevap .rt-content u {
            color: var(--primary-strong);
            text-decoration: underline;
            text-underline-offset: 3px;
            text-decoration-thickness: 2px;
        }

        .soru-cevap .rt-content blockquote {
            margin: 10px 0;
            padding: 8px 12px;
            border-left: 4px solid #93c5fd;
            background: #f8fafc;
            border-radius: 8px;
            color: #334155;
        }

        .soru-cevap .rt-content code {
            background: #f3f4f6;
            padding: .15rem .35rem;
            border-radius: 6px;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
            font-size: .9em;
        }

        .soru-cevap .rt-content pre {
            background: #0b1220;
            color: #f8fafc;
            padding: 12px;
            border-radius: 10px;
            overflow: auto;
        }

        .soru-cevap .rt-content table {
            width: 100%;
            border-collapse: collapse;
            margin: 10px 0 14px;
            font-size: 15px;
        }

        .soru-cevap .rt-content th, .soru-cevap .rt-content td {
            border: 1px solid #e5e7eb;
            padding: 8px 10px;
        }

        .soru-cevap .rt-content th {
            background: #f3f4f6;
            font-weight: 600;
        }

        .soru-cevap .rt-content img {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
            display: block;
            margin: 8px auto;
        }

        .soru-cevap .rt-content hr {
            border: none;
            border-top: 1px solid #e5e7eb;
            margin: 14px 0;
        }

    /* Eski düz-list stilini koru (rich text kullanılmasa da) */
    .soru-cevap ul {
        padding-left: 20px;
        margin: 10px 0;
    }

    .soru-cevap li {
        margin-bottom: 6px;
    }

@media (max-width:480px) {
    .soru-cevap {
        width: 95%;
        font-size: 14px;
        padding: 14px;
        border-radius: 8px;
    }
}

/* --------- Görsel Slider --------- */
.cevap-slider {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
    /* hizalama */
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

    .cevap-slider::-webkit-scrollbar {
        display: none;
    }

    .cevap-slider img {
        width: 120px;
        height: 120px;
        object-fit: cover;
        border-radius: 8px;
        flex-shrink: 0;
        box-shadow: var(--shadow-sm);
        cursor: pointer;
        transition: transform .2s ease-in-out;
    }

        .cevap-slider img:hover {
            transform: scale(1.05);
        }

@media (max-width:480px) {
    .cevap-slider img {
        width: 100px;
        height: 100px;
    }
}

/* --------- Yorum kartı, aksiyonlar --------- */
.comment-card {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
}

.btn-delete-comment {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

    .btn-delete-comment img {
        width: 18px;
        height: 18px;
    }

.comment-actions button {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
}

.comment-replies {
    margin-left: 20px;
    border-left: 2px solid #eee;
    padding-left: 10px;
    background: #fafafa;
    border-radius: 4px;
}

.reply-item {
    margin-top: 10px;
}

/* Yorumlar başlığı – içerikle hizalı (hem yeni .section-header hem eski h4+ikon için) */
.section-header,
h4:has(.fa-comments) {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 8px;
    padding: 0 8px;
    box-sizing: border-box;
}

    .section-header i,
    h4:has(.fa-comments) i {
        font-size: 18px;
        color: var(--primary-strong);
    }

    .section-header span,
    h4:has(.fa-comments) {
        font-size: 18px;
        font-weight: 700;
        color: #111827;
    }

/* Yorum listesi konteyneri ortalı */
#commentsArea {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 8px;
    box-sizing: border-box;
}

    #commentsArea .comment {
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        background: #fff;
        padding: 12px 14px;
        box-shadow: var(--shadow-sm);
    }

        #commentsArea .comment .mt-2 .btn {
            padding: 2px 8px;
        }

/* --------- Alt sabit eylem butonları --------- */
.yorum-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    height: var(--yf-h);
    background: #fff;
    border-top: 0;
    box-shadow: none;
}

body:has(.yorum-footer) {
    padding-bottom: calc(var(--yf-h) + 16px + env(safe-area-inset-bottom, 0px));
}

.btn-yorum-ekle,
.btn-duzenle {
    width: 180px !important;
    height: 52px !important;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    line-height: 52px;
    box-sizing: border-box;
    border-radius: 12px;
    border: 2px solid transparent;
    background-clip: padding-box;
    color: #fff !important;
}

    .btn-yorum-ekle img,
    .btn-duzenle img {
        width: 20px;
        height: 20px;
        filter: brightness(0) invert(1);
    }

.btn-yorum-ekle {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.btn-duzenle {
    background: linear-gradient(135deg, var(--amber), var(--amber-strong));
}

    .btn-yorum-ekle:hover, .btn-duzenle:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-lg);
    }

    .btn-yorum-ekle:active, .btn-duzenle:active {
        transform: translateY(0);
        box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    }

    .btn-yorum-ekle:focus-visible, .btn-duzenle:focus-visible {
        box-shadow: 0 0 0 3px rgba(59,130,246,0.35);
    }

@media (max-width:480px) {
    .yorum-footer {
        gap: 12px;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .btn-yorum-ekle, .btn-duzenle {
        min-width: 150px;
        height: 42px;
        font-size: 14px;
        line-height: 42px;
    }

    :root {
        --yf-h: 60px;
    }
}

/* --------- Misc --------- */
.hidden {
    display: none;
}

.badge.bg-secondary {
    font-size: .65rem;
}

.sss-question-title {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.sss-question-row, .sss-question-divider {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.sss-delete-btn img {
    filter: brightness(0) invert(1);
}
