/* 
 * Code Detail Wrapper - Basit Modern Açıklama Tasarımı
 * Kutu içinde kutu yok - Mobilde rahat okunabilir
 * ============================================
 */

.code-detail-wrapper {
    margin: 2rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    /* Yumuşak gradient beyaz çizgi: içte beyaz, dışta şeffaf gri; box-shadow köşede kesilmez */
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.12),
        0 0 0 3px rgba(220, 220, 230, 0.06);
}

/* Açıklama Başlığı - Modern Tasarım */
.code-detail-header {
    display: block;
    margin: 0 0 1.5rem 0;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg,
            rgba(15, 23, 42, 0.88) 0%,
            rgba(30, 41, 59, 0.85) 100%);
    /* Cam Efekti (Glassmorphism) */
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.code-detail-header:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 20px rgba(79, 195, 247, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    backdrop-filter: blur(14px) saturate(200%);
    -webkit-backdrop-filter: blur(14px) saturate(200%);
}

.code-detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(79, 195, 247, 0.7),
            rgba(6, 182, 212, 0.6));
    border-radius: 10px 0 0 10px;
    transition: width 0.3s ease;
}

.code-detail-header:hover::before {
    width: 5px;
}

.code-detail-header-content {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    position: relative;
    z-index: 1;
}

.code-detail-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg,
            rgba(79, 195, 247, 0.15) 0%,
            rgba(6, 182, 212, 0.12) 100%);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 8px;
    color: rgba(79, 195, 247, 0.9);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(79, 195, 247, 0.15);
}

.code-detail-header:hover .code-detail-header-icon {
    background: linear-gradient(135deg,
            rgba(79, 195, 247, 0.22) 0%,
            rgba(6, 182, 212, 0.18) 100%);
    border-color: rgba(79, 195, 247, 0.4);
    color: rgba(34, 211, 238, 1);
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.2);
    transform: scale(1.05);
}

.code-detail-header-title {
    flex: 1;
    color: rgba(226, 232, 240, 0.95);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    transition: color 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.code-detail-header:hover .code-detail-header-title {
    color: rgba(255, 255, 255, 1);
}

.code-detail-header-title .lang-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 5px;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.code-detail-header-title .lang-icon i {
    color: rgba(234, 179, 8, 0.9);
    filter: drop-shadow(0 2px 4px rgba(234, 179, 8, 0.3));
}

.code-detail-header:hover .code-detail-header-title .lang-icon {
    background: rgba(234, 179, 8, 0.2);
    border-color: rgba(234, 179, 8, 0.4);
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
}

.code-detail-header:hover .code-detail-header-title .lang-icon i {
    color: rgba(251, 191, 36, 1);
    filter: drop-shadow(0 3px 8px rgba(234, 179, 8, 0.5));
}

.code-detail-content {
    /* Katman 1 (üst): Opacity duvarı – yazıyı korur, pattern’i silik gösterir */
    /* Katman 2 (arka): ai-generated pattern – tekrarlı, arkada kalır */
    background-image:
        linear-gradient(135deg,
            rgba(15, 23, 42, 0.92) 0%,
            rgba(30, 41, 59, 0.88) 100%),
        url("../assets/images/ai-generated-3.png");
    background-size: 100% 100%, cover;
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, center center;
    /* Cam Efekti (Glassmorphism) */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Kenar gradienti: pattern taşmasını yumuşatır, border kalınlığında içe doğru beyaz geçiş */
.code-detail-content::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    background-image:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 0%, transparent 6px),
        linear-gradient(to top, rgba(255, 255, 255, 0.06) 0%, transparent 6px),
        linear-gradient(to right, rgba(255, 255, 255, 0.06) 0%, transparent 6px),
        linear-gradient(to left, rgba(255, 255, 255, 0.06) 0%, transparent 6px);
    background-size: 100% 6px, 100% 6px, 6px 100%, 6px 100%;
    background-repeat: no-repeat;
    background-position: 0 0, 0 100%, 0 0, 100% 0;
}

.code-detail-content>* {
    position: relative;
    z-index: 1;
}

.code-detail-content:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(14px) saturate(200%);
    -webkit-backdrop-filter: blur(14px) saturate(200%);
    transform: translateY(-1px);
}

.code-detail-text {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.code-detail-paragraph {
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0 0 1.25rem 0;
    padding: 0;
    text-align: justify;
    text-justify: inter-word;
    text-indent: 0;
    word-spacing: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.code-detail-paragraph:last-child {
    margin-bottom: 0;
}

/* Kopyalama Alanı - Sağ Üst (yeni kutu tasarımına uyumlu) */
.code-detail-copy-toolbar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

/* Mobilde açılır panel tetikleyicisi – sadece logo, masaüstünde gizli */
.code-detail-copy-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1rem;
    color: rgba(251, 191, 36, 0.95);
    background: linear-gradient(145deg,
            rgba(251, 191, 36, 0.18) 0%,
            rgba(245, 158, 11, 0.12) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.25),
        0 0 0 2px rgba(255, 255, 255, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.code-detail-copy-trigger i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.code-detail-copy-trigger:hover {
    color: rgba(253, 224, 71, 1);
    background: linear-gradient(145deg,
            rgba(251, 191, 36, 0.28) 0%,
            rgba(245, 158, 11, 0.2) 100%);
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.45),
        0 0 20px rgba(251, 191, 36, 0.12);
}

.code-detail-copy-toolbar-panel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Gizli native select (değer senkron için) */
.code-detail-copy-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    margin: -1px;
}

/* Özel select sarmalayıcı */
.code-detail-copy-select-wrap {
    position: relative;
    min-width: 0;
}

.code-detail-copy-select-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.95);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 0 0 2px rgba(255, 255, 255, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
    min-width: 120px;
}

/* Sekme seçimi (Mantık, Kod Analizi vb.) – daha geniş, dropdown sağa taşmasın */
.code-detail-copy-tab-wrap .code-detail-copy-select-trigger {
    min-width: 110px;
}

.code-detail-copy-tab-wrap .code-detail-copy-select-dropdown {
    left: auto;
    right: 0;
    min-width: 140px;
}

.code-detail-copy-select-trigger:hover {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.code-detail-copy-select-chevron {
    font-size: 0.65rem;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.code-detail-copy-select-wrap.is-open .code-detail-copy-select-chevron {
    transform: rotate(180deg);
}

/* Açılan liste kutusu – ana tasarım */
.code-detail-copy-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    margin-top: 0.35rem;
    min-width: 140px;
    width: max-content;
    padding: 0.35rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.97) 100%);
    border-radius: 10px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 25;
    flex-direction: column;
    gap: 2px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.code-detail-copy-select-wrap.is-open .code-detail-copy-select-dropdown {
    display: flex;
}

.code-detail-copy-select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.9);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.code-detail-copy-select-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.95);
}

.code-detail-copy-select-option.active {
    background: rgba(59, 130, 246, 0.22);
    color: rgba(147, 197, 253, 1);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.code-detail-copy-select-option.active:hover {
    background: rgba(59, 130, 246, 0.28);
}

.code-detail-copy-select-option i:first-child {
    width: 1rem;
    text-align: center;
    opacity: 0.9;
}

.code-detail-copy-tab-select,
.code-detail-copy-lang-select {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.95);
    background: rgba(15, 23, 42, 0.9);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0 2px rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.2s ease;
    min-width: 0;
}

.code-detail-copy-tab-select.code-detail-copy-select-native,
.code-detail-copy-lang-select.code-detail-copy-select-native {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.code-detail-copy-tab-select {
    max-width: 140px;
}

.code-detail-copy-tab-select:focus,
.code-detail-copy-lang-select:focus {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.code-detail-copy-tab-select option,
.code-detail-copy-lang-select option {
    background: #1e293b;
    color: #e2e8f0;
}

/* Kopyalama Butonu - sadece logo (ikon), farklı renk ve tasarım */
.code-detail-copy-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(145deg,
            rgba(251, 191, 36, 0.18) 0%,
            rgba(245, 158, 11, 0.12) 100%);
    border: none;
    border-radius: 10px;
    color: rgba(251, 191, 36, 0.95);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.95;
    font-size: 1rem;
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.25),
        0 0 0 2px rgba(255, 255, 255, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.code-detail-copy-btn i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.code-detail-content:hover .code-detail-copy-btn {
    opacity: 1;
}

.code-detail-copy-btn:hover {
    color: rgba(253, 224, 71, 1);
    background: linear-gradient(145deg,
            rgba(251, 191, 36, 0.28) 0%,
            rgba(245, 158, 11, 0.2) 100%);
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.45),
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 0 20px rgba(251, 191, 36, 0.15);
}

.code-detail-copy-btn:active {
    transform: scale(0.96);
}

.code-detail-copy-btn.copied {
    background: linear-gradient(135deg,
            rgba(34, 197, 94, 0.28) 0%,
            rgba(22, 163, 74, 0.2) 100%);
    color: rgba(74, 222, 128, 1);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.4),
        0 0 0 2px rgba(34, 197, 94, 0.25);
}

.code-detail-copy-btn.copied i::before {
    content: "\f00c";
}

/* Toast Bildirimi */
.code-detail-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg,
            rgba(15, 23, 42, 0.98) 0%,
            rgba(30, 41, 59, 0.95) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: rgba(226, 232, 240, 0.95);
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(34, 197, 94, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 300px;
}

.code-detail-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.code-detail-toast i {
    color: rgba(74, 222, 128, 0.9);
    font-size: 1.1rem;
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.4));
}

/* Yıldız Marker - Cümle Başları İçin (başlık ikondan hemen sonra, minimal boşluk) */
.code-detail-marker {
    display: inline-block;
    margin-left: 0;
    margin-right: 0.2rem;
    padding-left: 0;
    color: #a78bfa;
    font-weight: 600;
    font-size: 1.05em;
    vertical-align: baseline;
    line-height: 1;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Yıldız–başlık arası: başlık hafif sola çekilir (HTML boşluğu + marker margin-right dengelenir) */
.code-detail-paragraph .code-detail-marker+.subtle-underline-text {
    margin-left: -0.2rem;
    margin-right: 0;
}

.code-detail-marker::before {
    content: "✦";
    display: inline-block;
    color: #a78bfa;
    text-shadow:
        0 0 8px rgba(167, 139, 250, 0.6),
        0 0 12px rgba(167, 139, 250, 0.4);
    transform: rotate(0deg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.5));
}

.code-detail-marker:hover::before {
    color: #c4b5fd;
    transform: rotate(12deg) scale(1.02);
    text-shadow:
        0 0 12px rgba(196, 181, 253, 0.8),
        0 0 16px rgba(196, 181, 253, 0.6);
    filter: drop-shadow(0 0 6px rgba(196, 181, 253, 0.7));
}

.code-detail-wrapper:hover .code-detail-marker::before {
    color: #c4b5fd;
    transform: rotate(8deg) scale(1.02);
    text-shadow:
        0 0 10px rgba(196, 181, 253, 0.7),
        0 0 14px rgba(196, 181, 253, 0.5);
}

.code-detail-highlight {
    display: inline;
    color: rgba(79, 195, 247, 0.95);
    background: rgba(79, 195, 247, 0.12);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid rgba(79, 195, 247, 0.2);
    transition: all 0.2s ease;
}

.code-detail-highlight:hover {
    background: rgba(79, 195, 247, 0.18);
    border-color: rgba(79, 195, 247, 0.35);
    color: rgba(79, 195, 247, 1);
}

/* Algoritma Kodları İçin Premium Highlight */
.code-detail-code {
    display: inline;
    color: #06b6d4;
    background: linear-gradient(135deg,
            rgba(6, 182, 212, 0.2) 0%,
            rgba(8, 145, 178, 0.18) 50%,
            rgba(6, 182, 212, 0.2) 100%);
    padding: 0.25rem 0.6rem;
    border-radius: 0;
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 0.9em;
    font-weight: 700;
    border: none;
    border-left: 3px solid #06b6d4;
    border-right: 3px solid #06b6d4;
    box-shadow:
        0 0 10px rgba(6, 182, 212, 0.3),
        0 0 20px rgba(6, 182, 212, 0.15),
        inset 0 0 15px rgba(6, 182, 212, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-shadow:
        0 0 10px rgba(6, 182, 212, 0.6),
        0 0 20px rgba(6, 182, 212, 0.4);
    letter-spacing: 0.5px;
    overflow: hidden;
}

.code-detail-code::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(6, 182, 212, 0.1) 50%,
            transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 0;
}

.code-detail-code:hover::before {
    transform: translateX(100%);
}

.code-detail-code:hover {
    color: #22d3ee;
    background: linear-gradient(135deg,
            rgba(6, 182, 212, 0.28) 0%,
            rgba(8, 145, 178, 0.25) 50%,
            rgba(6, 182, 212, 0.28) 100%);
    border-left-color: #22d3ee;
    border-right-color: #22d3ee;
    box-shadow:
        0 0 15px rgba(6, 182, 212, 0.5),
        0 0 30px rgba(6, 182, 212, 0.3),
        0 0 45px rgba(6, 182, 212, 0.15),
        inset 0 0 20px rgba(6, 182, 212, 0.15);
    transform: translateY(-2px) scale(1.02);
    text-shadow:
        0 0 15px rgba(34, 211, 238, 0.8),
        0 0 30px rgba(34, 211, 238, 0.5),
        0 0 45px rgba(34, 211, 238, 0.3);
}

.code-detail-code::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
            #06b6d4,
            #22d3ee,
            #06b6d4,
            #22d3ee);
    background-size: 400% 400%;
    opacity: 0;
    z-index: -1;
    filter: blur(8px);
    animation: gradientShift 3s ease infinite;
    transition: opacity 0.4s ease;
}

.code-detail-code:hover::after {
    opacity: 0.6;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   Mobil Tasarım - Kutu içinde kutu yok
   ============================================ */

@media screen and (max-width: 768px) {
    .code-detail-wrapper {
        margin: 1.5rem 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .code-detail-header {
        margin: 0 0 1.25rem 0;
        padding: 0.875rem 1rem;
        border-radius: 8px;
    }

    .code-detail-header::before {
        width: 3px;
        border-radius: 8px 0 0 8px;
    }

    .code-detail-header-content {
        gap: 0.75rem;
    }

    .code-detail-header-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .code-detail-header-title {
        font-size: 0.9rem;
    }

    .code-detail-header-title .lang-icon {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
        margin-left: 0.4rem;
    }

    .code-detail-content {
        padding: 1rem;
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
    }

    .code-detail-tabs-container {
        margin-bottom: 1rem;
    }

    .code-detail-tabs-container.code-detail-tabs-primary {
        margin-bottom: 0.75rem;
    }

    .code-detail-tabs-container.code-detail-tabs-secondary {
        margin-bottom: 1rem;
        margin-top: 0.5rem;
    }

    .code-detail-tabs-divider {
        margin: 0.5rem 0;
    }

    .code-detail-tabs {
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    .code-detail-tab {
        padding: 6px 12px;
        font-size: 0.75rem;
        gap: 4px;
    }

    .code-detail-tab-secondary {
        padding: 6px 12px;
        font-size: 0.75rem;
        gap: 4px;
    }

    .code-detail-text {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
    }

    .code-detail-text {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .code-detail-paragraph {
        font-size: 0.9rem;
        line-height: 1.75;
        margin: 0 0 0.5rem 0;
        padding: 0;
        text-align: justify;
        text-justify: inter-word;
        word-spacing: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Paragraftan sonra gelen error box için margin azalt */
    .code-detail-paragraph+.code-detail-error-box {
        margin-top: 0.5rem;
    }

    .code-detail-copy-toolbar {
        top: 0.75rem;
        right: 0.75rem;
        gap: 0;
        flex-direction: column;
        align-items: flex-end;
    }

    .code-detail-copy-trigger {
        display: flex;
    }

    .code-detail-copy-toolbar-panel {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 0.35rem;
        flex-direction: column;
        align-items: stretch;
        min-width: 180px;
        padding: 0.75rem;
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.96) 100%);
        border-radius: 12px;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.2),
            0 8px 24px rgba(0, 0, 0, 0.35);
        gap: 0.5rem;
        z-index: 20;
    }

    .code-detail-copy-toolbar.is-open .code-detail-copy-toolbar-panel {
        display: flex;
    }

    .code-detail-copy-toolbar-panel .code-detail-copy-select-wrap {
        width: 100%;
    }

    .code-detail-copy-toolbar-panel .code-detail-copy-select-trigger {
        width: 100%;
        justify-content: space-between;
        min-width: 0;
    }

    /* Mobilde dil ve sekme select kutuları aynı genişlikte (üstteki dil = alttaki tab) */
    .code-detail-copy-toolbar-panel .code-detail-copy-select-dropdown {
        width: 100%;
        min-width: 0;
        left: 0;
        right: 0;
        box-sizing: border-box;
    }

    .code-detail-copy-toolbar-panel .code-detail-copy-btn {
        width: 100%;
        margin-top: 0.25rem;
    }

    .code-detail-copy-tab-select,
    .code-detail-copy-lang-select {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .code-detail-copy-tab-select {
        max-width: 110px;
    }

    .code-detail-copy-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .code-detail-toast {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
        max-width: 250px;
    }

    .code-detail-highlight {
        padding: 0.12rem 0.35rem;
        font-size: 0.85em;
        display: inline;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .code-detail-code {
        padding: 0.2rem 0.5rem;
        font-size: 0.85em;
        display: inline;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        border-left-width: 2px;
        border-right-width: 2px;
    }

    .code-detail-code::after {
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
        filter: blur(6px);
    }

}

@media screen and (max-width: 600px) {
    .code-detail-wrapper {
        margin: 1.25rem 0;
    }

    .code-detail-header {
        margin: 0 0 1rem 0;
        padding: 0.75rem 0.875rem;
        border-radius: 7px;
    }

    .code-detail-header::before {
        width: 3px;
    }

    .code-detail-header-content {
        gap: 0.65rem;
    }

    .code-detail-header-icon {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .code-detail-header-title {
        font-size: 0.85rem;
    }

    .code-detail-header-title .lang-icon {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
        margin-left: 0.35rem;
    }

    .code-detail-content {
        padding: 0.875rem;
        border-radius: 5px;
    }

    .code-detail-tabs-container {
        margin-bottom: 0.875rem;
    }

    .code-detail-tabs-container.code-detail-tabs-primary {
        margin-bottom: 0.625rem;
    }

    .code-detail-tabs-container.code-detail-tabs-secondary {
        margin-bottom: 0.875rem;
        margin-top: 0.4rem;
    }

    .code-detail-tabs-divider {
        margin: 0.4rem 0;
    }

    .code-detail-tabs {
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .code-detail-tab {
        padding: 5px 10px;
        font-size: 0.7rem;
        gap: 3px;
    }

    .code-detail-tab-secondary {
        padding: 5px 10px;
        font-size: 0.7rem;
        gap: 3px;
    }

    .code-detail-tabs {
        gap: 0.35rem;
    }

    .code-detail-tab {
        padding: 5px 10px;
        font-size: 0.7rem;
        gap: 3px;
    }

    .code-detail-paragraph {
        font-size: 0.85rem;
        line-height: 1.7;
        margin: 0 0 0.875rem 0;
        text-align: justify;
        text-justify: inter-word;
        word-spacing: normal;
    }

    .code-detail-copy-toolbar {
        top: 0.5rem;
        right: 0.5rem;
    }

    .code-detail-copy-trigger {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .code-detail-copy-toolbar-panel {
        min-width: 160px;
        padding: 0.6rem;
        margin-top: 0.3rem;
    }

    .code-detail-copy-toolbar-panel .code-detail-copy-select-dropdown {
        width: 100%;
        min-width: 0;
        left: 0;
        right: 0;
        box-sizing: border-box;
    }

    .code-detail-copy-tab-select,
    .code-detail-copy-lang-select {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }

    .code-detail-copy-tab-select {
        max-width: 95px;
    }

    .code-detail-copy-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .code-detail-copy-toolbar-panel .code-detail-copy-btn {
        width: 100%;
    }

    .code-detail-toast {
        bottom: 0.75rem;
        right: 0.75rem;
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
        max-width: 200px;
    }

    .code-detail-highlight {
        padding: 0.1rem 0.3rem;
        font-size: 0.8em;
    }

    .code-detail-code {
        padding: 0.18rem 0.45rem;
        font-size: 0.8em;
        border-left-width: 2px;
        border-right-width: 2px;
        letter-spacing: 0.3px;
    }

    .code-detail-code::after {
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
        filter: blur(5px);
    }

    .code-detail-paragraph {
        margin-bottom: 0.4rem;
        text-justify: inter-word;
        word-spacing: normal;
    }
}

/* ============================================
   Scrollbar Stilleri
   ============================================ */

/* ============================================
   Tab Badge Sistemi
   ============================================ */

.code-detail-tabs-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

/* Üst Seviye: Dil Tab'ları */
.code-detail-tabs-container.code-detail-tabs-primary {
    margin-bottom: 1rem;
}

/* Alt Seviye: İçerik Tab'ları */
.code-detail-tabs-container.code-detail-tabs-secondary {
    margin-bottom: 1.25rem;
    margin-top: 0.5rem;
}

/* Alt Çizgi - Tab'lar Arası Ayırıcı */
.code-detail-tabs-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 20%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.1) 80%,
            transparent 100%);
    margin: 0.75rem 0;
    position: relative;
}

.code-detail-tabs-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(79, 195, 247, 0.2) 50%,
            transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.code-detail-tabs-container:hover~.code-detail-tabs-divider::before,
.code-detail-tabs-divider:hover::before {
    opacity: 1;
}

.code-detail-tabs {
    display: flex;
    gap: 0.5rem;
}

.code-detail-tab {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.6) 0%, rgba(40, 40, 40, 0.8) 100%);
    border: none;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.015em;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.code-detail-tab::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.4s ease;
}

.code-detail-tab:hover::before {
    left: 100%;
}

/* HTML Tab */
.code-detail-tab[data-target*="html"] {
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.code-detail-tab[data-target*="html"]:hover {
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.12) 0%,
            rgba(220, 38, 38, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    color: #f3f4f6;
}

.code-detail-tab[data-target*="html"].active {
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.18) 0%,
            rgba(220, 38, 38, 0.22) 100%);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
}

.code-detail-tab[data-target*="html"] i {
    color: rgba(239, 68, 68, 0.85);
    transition: all 0.3s ease;
}

.code-detail-tab[data-target*="html"]:hover i,
.code-detail-tab[data-target*="html"].active i {
    color: rgba(239, 68, 68, 0.95);
}

/* CSS Tab */
.code-detail-tab[data-target*="css"] {
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.code-detail-tab[data-target*="css"]:hover {
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.12) 0%,
            rgba(37, 99, 235, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    color: #f3f4f6;
}

.code-detail-tab[data-target*="css"].active {
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.18) 0%,
            rgba(37, 99, 235, 0.22) 100%);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
}

.code-detail-tab[data-target*="css"] i {
    color: rgba(59, 130, 246, 0.85);
    transition: all 0.3s ease;
}

.code-detail-tab[data-target*="css"]:hover i,
.code-detail-tab[data-target*="css"].active i {
    color: rgba(59, 130, 246, 0.95);
}

/* JavaScript Tab */
.code-detail-tab[data-target*="js"] {
    border: 1px solid rgba(234, 179, 8, 0.15);
}

.code-detail-tab[data-target*="js"]:hover {
    background: linear-gradient(135deg,
            rgba(234, 179, 8, 0.12) 0%,
            rgba(202, 138, 4, 0.15) 100%);
    border-color: rgba(234, 179, 8, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    color: #f3f4f6;
}

.code-detail-tab[data-target*="js"].active {
    background: linear-gradient(135deg,
            rgba(234, 179, 8, 0.18) 0%,
            rgba(202, 138, 4, 0.22) 100%);
    border-color: rgba(234, 179, 8, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
}

.code-detail-tab[data-target*="js"] i {
    color: rgba(234, 179, 8, 0.85);
    transition: all 0.3s ease;
}

.code-detail-tab[data-target*="js"]:hover i,
.code-detail-tab[data-target*="js"].active i {
    color: rgba(234, 179, 8, 0.95);
}

/* Alt Seviye Tab Butonları (İçerik Tab'ları) */
.code-detail-tab-secondary {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.5) 0%, rgba(40, 40, 40, 0.7) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #d1d5db;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.015em;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-detail-tab-secondary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.4s ease;
}

.code-detail-tab-secondary:hover::before {
    left: 100%;
}

.code-detail-tab-secondary:hover {
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.7) 0%, rgba(50, 50, 50, 0.85) 100%);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.code-detail-tab-secondary.active {
    background: linear-gradient(135deg,
            rgba(79, 195, 247, 0.15) 0%,
            rgba(59, 130, 246, 0.18) 100%);
    border-color: rgba(79, 195, 247, 0.3);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 15px rgba(79, 195, 247, 0.15);
}

.code-detail-tab-secondary i {
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.code-detail-tab-secondary:hover i,
.code-detail-tab-secondary.active i {
    color: rgba(79, 195, 247, 0.9);
    filter: drop-shadow(0 0 4px rgba(79, 195, 247, 0.4));
}

/* Mantık Tab */
.code-detail-tab-secondary[data-target*="logic"]:hover,
.code-detail-tab-secondary[data-target*="logic"].active {
    background: linear-gradient(135deg,
            rgba(139, 92, 246, 0.15) 0%,
            rgba(124, 58, 237, 0.18) 100%);
    border-color: rgba(139, 92, 246, 0.3);
}

.code-detail-tab-secondary[data-target*="logic"]:hover i,
.code-detail-tab-secondary[data-target*="logic"].active i {
    color: rgba(167, 139, 250, 0.95);
}

/* Hata Mesajı Tab */
.code-detail-tab-secondary[data-target*="error"]:hover,
.code-detail-tab-secondary[data-target*="error"].active {
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.15) 0%,
            rgba(220, 38, 38, 0.18) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.code-detail-tab-secondary[data-target*="error"]:hover i,
.code-detail-tab-secondary[data-target*="error"].active i {
    color: rgba(248, 113, 113, 0.95);
}

/* Best Practice Tab */
.code-detail-tab-secondary[data-target*="best-practice"]:hover,
.code-detail-tab-secondary[data-target*="best-practice"].active {
    background: linear-gradient(135deg,
            rgba(34, 197, 94, 0.15) 0%,
            rgba(22, 163, 74, 0.18) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

.code-detail-tab-secondary[data-target*="best-practice"]:hover i,
.code-detail-tab-secondary[data-target*="best-practice"].active i {
    color: rgba(74, 222, 128, 0.95);
}

/* Hata Mesajı Kutusu - canlı premium tasarım; scroll sadece pre'de */
.code-detail-error-box {
    position: relative;
    margin: 0.5rem 0;
    padding: 10px 14px;
    background: linear-gradient(135deg,
            rgba(45, 35, 45, 0.95) 0%,
            rgba(30, 25, 35, 0.98) 50%,
            rgba(25, 20, 30, 0.98) 100%);
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-left: 4px solid rgba(251, 146, 60, 0.95);
    border-radius: 8px;
    box-shadow:
        0 0 8px rgba(248, 113, 113, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    min-height: 0;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Üst kenar ince ışık çizgisi - premium detay */
.code-detail-error-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg,
            rgba(251, 146, 60, 0.5) 0%,
            rgba(248, 113, 113, 0.25) 40%,
            transparent 100%);
    pointer-events: none;
}

.code-detail-error-box pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: rgba(254, 215, 215, 0.98);
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
    font-size: 0.84rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
    white-space: pre;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    text-shadow: 0 0 20px rgba(251, 146, 60, 0.15), 0 0 40px rgba(248, 113, 113, 0.08);
}

.code-detail-error-box code {
    color: inherit;
    background: transparent;
    padding: 0;
    border: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    display: inline-block;
    vertical-align: middle;
    width: auto;
    min-width: min-content;
    overflow: visible;
    box-sizing: border-box;
}

.code-detail-paragraph+.code-detail-error-box {
    margin-top: 0.4rem;
}

/* Code Detail Error Box - Scrollbar (pre içinde, canlı görünüm) */
.code-detail-error-box pre {
    scrollbar-width: thin;
    scrollbar-color: rgba(251, 146, 60, 0.55) rgba(35, 25, 40, 0.7);
}

.code-detail-error-box pre::-webkit-scrollbar {
    height: 6px;
}

.code-detail-error-box pre::-webkit-scrollbar-track {
    background: rgba(35, 25, 40, 0.7);
    border-radius: 4px;
}

.code-detail-error-box pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(251, 146, 60, 0.6), rgba(248, 113, 113, 0.5));
    border-radius: 4px;
}

.code-detail-error-box pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, rgba(251, 146, 60, 0.85), rgba(248, 113, 113, 0.75));
}

/* Tab Content */
.code-detail-tab-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 3 dil: dil kapsayıcı (script ile display none/block yapılır) */
.code-detail-lang-pane {
    display: block;
}

.code-detail-pane {
    display: none;
}

.code-detail-pane.active {
    display: block;
}

/* ============================================
   Scrollbar Stilleri
   ============================================ */

.code-detail-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(51, 65, 85, 0.85) rgba(226, 232, 240, 0.15);
}

.code-detail-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.code-detail-content::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.1);
    border-radius: 3px;
}

.code-detail-content::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.7);
    border-radius: 3px;
}

.code-detail-content::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 65, 85, 0.9);
}