/**
 * ICD-10 Sayfaları Stilleri
 * Vademecum Online - Programatik SEO
 * 
 * Temiz, kurumsal, tıp dünyasına uygun tasarım.
 * Ana projenin CSS değişkenlerini kullanır.
 */

/* ========================================
   HERO / SAYFA BAŞLIĞI
   ======================================== */

.icd-hero {
    padding: 120px 0 48px;
    background: var(--color-bg-light);
}

.icd-hero-category {
    padding-bottom: 32px;
}

/* Hero Grid Layout */
.icd-hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: start;
}

.icd-hero-content {
    flex: 1;
}

/* İstatistik Kartları - Yatay Kompakt */
.icd-hero-stats {
    display: flex;
    gap: 24px;
    background: var(--color-white);
    padding: 24px 32px;
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    margin-top: 8px;
}

.icd-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 70px;
}

.icd-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #B62727;
    line-height: 1;
}

.icd-stat-label {
    font-size: 0.75rem;
    color: var(--color-gray-light);
    margin-top: 4px;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 900px) {
    .icd-hero-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .icd-hero-stats {
        justify-content: center;
        padding: 20px 24px;
    }
}

@media (max-width: 500px) {
    .icd-hero-stats {
        gap: 16px;
        padding: 16px 20px;
    }
    
    .icd-stat-number {
        font-size: 1.5rem;
    }
}

/* Breadcrumb */
.icd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    color: var(--color-gray-light);
}

.icd-breadcrumb a {
    color: var(--color-gray-light);
}

.icd-breadcrumb a:hover {
    color: var(--color-primary);
}

.icd-breadcrumb-sep {
    color: var(--color-gray-light);
    opacity: 0.5;
}

.icd-breadcrumb-current {
    color: var(--color-dark);
    font-weight: 500;
}

/* Sayfa başlığı */
.icd-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.icd-page-subtitle {
    font-size: 1.125rem;
    color: var(--color-gray-light);
    margin-bottom: 32px;
}

.icd-page-meta {
    font-size: 0.9rem;
    color: var(--color-gray-light);
    margin-top: 8px;
}

/* Kategori header */
.icd-category-header {
    margin-bottom: 32px;
}

.icd-category-badge {
    display: inline-block;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: var(--font-mono, monospace);
    color: #B62727;
}

/* ========================================
   ARAMA KUTUSU
   ======================================== */

.icd-search-wrapper {
    position: relative;
    max-width: 600px;
    margin-bottom: 24px;
}

.icd-search-box {
    display: flex;
    align-items: center;
    background: var(--color-white);
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-sm);
    padding: 0 16px;
    transition: border-color 0.2s;
}

.icd-search-box:focus-within {
    border-color: var(--color-primary);
}

.icd-search-box i {
    color: var(--color-gray-light);
    font-size: 1rem;
    margin-right: 12px;
}

.icd-search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 0;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
}

.icd-search-box input::placeholder {
    color: #9CA3AF;
}

.icd-search-clear {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-gray-light);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.icd-search-clear:hover {
    color: var(--color-dark);
}

/* Arama sonuçları dropdown */
.icd-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.icd-search-results.visible {
    display: block;
}

.icd-search-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background 0.15s;
}

.icd-search-item:last-child {
    border-bottom: none;
}

.icd-search-item:hover,
.icd-search-item.active {
    background: #F9FAFB;
}

.icd-search-code {
    flex-shrink: 0;
    background: #EFF6FF;
    color: #1D4ED8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
}

.icd-search-desc {
    color: var(--color-dark);
    font-size: 0.9rem;
    line-height: 1.4;
}

.icd-search-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--color-gray-light);
}

/* ========================================
   YÜZEN CTA BUTONU
   ======================================== */

.icd-floating-cta {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99;
    display: block;
    background: linear-gradient(135deg, #D32F2F 0%, #B62727 55%, #8B1E1E 100%);
    color: var(--color-white);
    padding: 16px 22px;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(182, 39, 39, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: icd-cta-bounce 2.4s ease-in-out infinite;
    max-width: 300px;
}

.icd-floating-cta:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 44px rgba(182, 39, 39, 0.6);
    animation: none;
}

/* Hafif zıplama ile dikkat çekme */
@keyframes icd-cta-bounce {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 8px 28px rgba(182, 39, 39, 0.45);
    }
    50% {
        transform: translateY(-6px);
        box-shadow: 0 16px 40px rgba(182, 39, 39, 0.6);
    }
}

/* "Sağlık Profesyonellerine Özel" rozeti */
.icd-floating-cta-badge {
    position: absolute;
    top: -11px;
    left: 18px;
    background: #fff;
    color: #B62727;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.icd-floating-cta-body {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icd-floating-cta-text {
    display: flex;
    flex-direction: column;
}

.icd-floating-cta-title {
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.25;
}

.icd-floating-cta-subtitle {
    font-size: 0.75rem;
    opacity: 0.92;
    margin-top: 3px;
    font-weight: 500;
}

/* Sağdaki ok - sürekli hafif hareket */
.icd-floating-cta-arrow {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    animation: icd-cta-arrow 1.2s ease-in-out infinite;
}

.icd-floating-cta:hover .icd-floating-cta-arrow {
    background: rgba(255,255,255,0.3);
}

@keyframes icd-cta-arrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

@media (max-width: 768px) {
    .icd-floating-cta {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        padding: 14px 20px;
        border-radius: 12px;
    }
}

/* ========================================
   KATEGORİ LİSTESİ (INDEX SAYFASI)
   ======================================== */

.icd-categories {
    padding: 48px 0;
}

.icd-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 20px;
}

.icd-categories-list {
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.icd-category-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.15s;
}

.icd-category-item:last-child {
    border-bottom: none;
}

.icd-category-item:hover {
    background: #FAFAFA;
}

.icd-category-item:hover .icd-category-arrow {
    color: var(--color-primary);
    transform: translateX(4px);
}

.icd-category-code {
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    margin-right: 20px;
    min-width: 80px;
}

/* Ana Kategori Kod Rengi - Vademecum Kırmızı */
.icd-category-code {
    color: #B62727;
}

.icd-category-name {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--color-dark);
    line-height: 1.4;
}

.icd-category-count {
    flex-shrink: 0;
    font-size: 0.8125rem;
    color: var(--color-gray-light);
    margin-right: 16px;
}

.icd-category-arrow {
    flex-shrink: 0;
    color: #D1D5DB;
    transition: color 0.15s, transform 0.15s;
}

.icd-category-arrow i {
    font-size: 0.875rem;
}

/* ========================================
   AKORDEON (DETAILS/SUMMARY)
   ======================================== */

.icd-content {
    padding: 32px 0 48px;
}

.icd-accordion-wrapper {
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
}

/* Details/Summary akordeon */
.icd-accordion {
    border-bottom: 1px solid #E5E7EB;
}

.icd-accordion:last-child {
    border-bottom: none;
}

.icd-accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background 0.15s;
}

.icd-accordion-header::-webkit-details-marker {
    display: none;
}

.icd-accordion-header:hover {
    background: #F9FAFB;
}

.icd-accordion[open] > .icd-accordion-header {
    background: #F3F4F6;
    border-bottom: 1px solid #E5E7EB;
}

/* Toggle ikonu */
.icd-toggle-icon {
    margin-left: auto;
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.icd-toggle-icon::before,
.icd-toggle-icon::after {
    content: '';
    position: absolute;
    background: var(--color-gray-light);
    transition: transform 0.2s;
}

.icd-toggle-icon::before {
    width: 12px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.icd-toggle-icon::after {
    width: 2px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.icd-accordion[open] > .icd-accordion-header .icd-toggle-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* Akordeon içeriği */
.icd-accordion-content {
    padding-left: 20px;
    border-left: 2px solid #E5E7EB;
    margin-left: 20px;
}

/* Leaf (uç) elemanlar */
.icd-leaf {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #F3F4F6;
}

.icd-leaf:last-child {
    border-bottom: none;
}

/* SGK Geri Ödeme Kancası - Zarif outline, hover'da dolu */
.icd-sgk-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #B62727;
    background: rgba(182, 39, 39, 0.06);
    border: 1.5px solid rgba(182, 39, 39, 0.35);
    padding: 6px 14px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.icd-sgk-link i {
    font-size: 0.6875rem;
    transition: transform 0.2s ease;
}

.icd-sgk-link:hover {
    color: #fff;
    background: linear-gradient(135deg, #D32F2F 0%, #B62727 100%);
    border-color: #B62727;
    box-shadow: 0 4px 14px rgba(182, 39, 39, 0.35);
}

.icd-sgk-link:hover i {
    transform: translateX(3px);
}

/* Aranıp bulunan (highlight) satırda buton dikkat çeker */
.icd-leaf.icd-highlight .icd-sgk-link {
    color: #fff;
    background: linear-gradient(135deg, #D32F2F 0%, #B62727 100%);
    border-color: #B62727;
    box-shadow: 0 0 0 0 rgba(182, 39, 39, 0.5);
    animation: icd-sgk-pulse 1.4s ease-out infinite;
}

@keyframes icd-sgk-pulse {
    0% { box-shadow: 0 0 0 0 rgba(182, 39, 39, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(182, 39, 39, 0); }
    100% { box-shadow: 0 0 0 0 rgba(182, 39, 39, 0); }
}

.icd-leaf.icd-highlight .icd-sgk-link i {
    transform: translateX(3px);
}

@media (max-width: 768px) {
    .icd-leaf {
        flex-wrap: wrap;
    }
    
    .icd-sgk-link {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
        justify-content: center;
        padding: 9px 16px;
    }
}

/* Hiyerarşi derinlik girintileri */
.icd-depth-0 > .icd-accordion-header,
.icd-depth-0.icd-leaf {
    padding-left: 20px;
}

.icd-depth-1 > .icd-accordion-header,
.icd-depth-1.icd-leaf {
    padding-left: 40px;
}

.icd-depth-2 > .icd-accordion-header,
.icd-depth-2.icd-leaf {
    padding-left: 60px;
}

.icd-depth-3 > .icd-accordion-header,
.icd-depth-3.icd-leaf {
    padding-left: 80px;
}

.icd-depth-4 > .icd-accordion-header,
.icd-depth-4.icd-leaf {
    padding-left: 100px;
}

/* ICD Kod ve Açıklama */
.icd-code {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    min-width: 70px;
}

/* Alt Kategori Kod Rengi - Indigo */
.icd-code {
    color: #4F46E5;
}

.icd-description {
    flex: 1;
    color: var(--color-dark);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ========================================
   HIGHLIGHT (VURGULAMA)
   ======================================== */

.icd-highlight {
    animation: icd-highlight-pulse 0.5s ease-out;
    background-color: #FEF3C7 !important;
}

@keyframes icd-highlight-pulse {
    0% {
        background-color: #FDE68A;
    }
    100% {
        background-color: #FEF3C7;
    }
}

.icd-accordion.icd-highlight > .icd-accordion-header {
    background-color: #FEF3C7;
}

.icd-leaf.icd-highlight {
    background-color: #FEF3C7;
}

/* ========================================
   YASAL UYARI
   ======================================== */

.icd-disclaimer {
    padding: 0 0 64px;
}

.icd-disclaimer-box {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
    padding: 24px;
}

.icd-disclaimer-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 12px;
}

.icd-disclaimer-box h3 i {
    color: #9CA3AF;
}

.icd-disclaimer-box p {
    font-size: 0.8125rem;
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .icd-hero {
        padding: 100px 0 32px;
    }
    
    .icd-page-title {
        font-size: 1.5rem;
    }
    
    .icd-category-item {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .icd-category-code {
        width: auto;
        margin-right: 12px;
    }
    
    .icd-category-name {
        width: 100%;
        order: 3;
        font-size: 0.875rem;
        margin-top: 4px;
    }
    
    .icd-category-count {
        margin-left: auto;
        margin-right: 8px;
    }
    
    .icd-category-arrow {
        order: 2;
    }
    
    .icd-accordion-header {
        padding: 12px 16px;
    }
    
    .icd-depth-0 > .icd-accordion-header,
    .icd-depth-0.icd-leaf { padding-left: 16px; }
    
    .icd-depth-1 > .icd-accordion-header,
    .icd-depth-1.icd-leaf { padding-left: 28px; }
    
    .icd-depth-2 > .icd-accordion-header,
    .icd-depth-2.icd-leaf { padding-left: 40px; }
    
    .icd-depth-3 > .icd-accordion-header,
    .icd-depth-3.icd-leaf { padding-left: 52px; }
    
    .icd-depth-4 > .icd-accordion-header,
    .icd-depth-4.icd-leaf { padding-left: 64px; }
    
    .icd-code {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    
    .icd-description {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .icd-search-box {
        padding: 0 12px;
    }
    
    .icd-cta-banner {
        padding: 16px 20px;
    }
    
    .icd-cta-content p {
        font-size: 0.875rem;
    }
}
