/* Fonwise Docs - Ana Stil Dosyası */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
    --header-height: 60px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
    font-size: 16px;
}
html, body {
    scroll-behavior: smooth;
}

/* Üst Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1001;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}

.header-left {
    flex-shrink: 0;
}

.header-left .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}

.header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid #10b981;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
    font-size: 0.9rem;
    background: var(--bg-color);
}

.language-selector:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #059669;
}

.language-flag {
    font-size: 1.2rem;
    line-height: 1;
}

.language-name {
    font-weight: 500;
}

.language-selector i {
    font-size: 0.75rem;
    color: var(--text-light);
    transition: var(--transition);
}

.language-selector.active i {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.language-dropdown.active {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--bg-light);
}

.language-option.active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-weight: 600;
}

.language-option .flag {
    font-size: 1.2rem;
    line-height: 1;
}

/* Container */
.docs-container {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* Sidebar */
.docs-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: calc(100vh - var(--header-height));
    top: var(--header-height);
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 1rem 1.5rem;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* Arama Kutusu (Header'da) */
.header-center .search-box {
    position: relative;
    width: 100%;
}

.header-center .search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--bg-light);
}

.header-center .search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--bg-color);
}

.header-center .search-box i:first-child {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.9rem;
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-light);
}

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

.search-result-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.search-result-category {
    font-size: 0.85rem;
    color: var(--text-light);
}

.search-result-snippet {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Menü */
.docs-menu {
    padding: 1rem 0;
}

.menu-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

.menu-section {
    margin-bottom: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
    cursor: pointer;
    gap: 0.75rem;
}

.menu-item span {
    flex: 1;
}

/* Ana kategorilerde ikonlar (dairesel arka plan) */
.menu-item:not(.menu-item-child) > i:first-child {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
    border-radius: 50%;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.menu-item.expanded:not(.menu-item-child) > i:first-child,
.menu-item.active:not(.menu-item-child) > i:first-child {
    background: #14b8a6;
    color: white;
}

/* Alt kategorilerde ikon stili */
.menu-item-child > i:first-child {
    width: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.menu-item-child.active > i:first-child {
    color: inherit;
}

.menu-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.menu-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* Alt kategoriler için aktif durum (turuncu) */
.menu-item-child.active {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border-left-color: #f97316;
    font-weight: 600;
}

/* İkon stilleri yukarıda tanımlandı */

.menu-item.has-children {
    position: relative;
}

.menu-arrow {
    position: absolute;
    right: 1.5rem;
    font-size: 0.75rem;
    transition: var(--transition);
    color: var(--text-light);
    flex-shrink: 0;
}

.menu-item.has-children.expanded .menu-arrow {
    transform: rotate(180deg);
}

.menu-item-child {
    padding-left: 3rem !important;
    font-size: 0.9rem;
    position: relative;
}

/* Alt kategoriler için sol çizgi */
.menu-item-child::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.menu-item-child.active::before {
    background: #f97316;
}

.menu-submenu {
    display: none;
    background: var(--bg-light);
}

.menu-submenu.active {
    display: block;
}

.menu-submenu .menu-item {
    font-size: 0.9rem;
}

/* Ana İçerik */
.docs-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--header-height));
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-loading,
.page-not-found {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.page-not-found i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.page-not-found h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Makale */
.docs-article {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.article-title-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-body-wrapper {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 3rem;
    position: relative;
}

.article-body {
    font-size: 1rem;
    line-height: 1.1;
    color: var(--text-color);
    min-width: 0; /* Grid overflow için */
}

/* Table of Contents - Bu Sayfada */
.table-of-contents {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 4rem);
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.table-of-contents h3 {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-color);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-item {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 4px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.toc-item:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.toc-item.active {
    color: var(--text-color);
    font-weight: 600;
    background: rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary-color);
}

.toc-item.level-2 {
    padding-left: 0.75rem;
}

.toc-item.level-3 {
    padding-left: 1.5rem;
    font-size: 0.8125rem;
}

.toc-item.level-4 {
    padding-left: 2.25rem;
    font-size: 0.75rem;
}

.article-body h2 {
    font-size: 25px;
    font-weight: 400;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    scroll-margin-top: var(--header-height);
}

.article-body h3 {
    font-size: 20px;
    font-weight: 400;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    scroll-margin-top: var(--header-height);
}

.article-body h4 {
    font-size: 1.75rem;
    font-weight: 400;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    scroll-margin-top: var(--header-height);
}

.article-body p {
    margin-bottom: 0.75rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 0.75rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.25rem;
}

.article-body code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e11d48;
}

.article-body pre {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-body table th,
.article-body table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.article-body table th {
    background: var(--bg-light);
    font-weight: 600;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}

/* Alert/Kart Bileşenleri */
.article-body .alert-box {
    position: relative;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    border-left: 4px solid;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.article-body .alert-box.alert-info {
    background: #f0f7ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.article-body .alert-box.alert-warning {
    background: #fffbf0;
    border-left-color: #f59e0b;
    color: #92400e;
}

.article-body .alert-box.alert-danger {
    background: #fff5f5;
    border-left-color: #ef4444;
    color: #991b1b;
}

.article-body .alert-box.alert-success {
    background: #f0fdf4;
    border-left-color: #10b981;
    color: #065f46;
}

.article-body .alert-icon-col {
    flex: 0 0 auto;
    font-size: 1.4rem;
    line-height: 1;
    padding-top: 0.1rem;
}

.article-body .alert-content {
    flex: 1;
    min-width: 0;
}

.article-body .alert-title {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    line-height: 1.4;
}

.article-body .alert-body {
    line-height: 1.6;
    margin: 0;
    color: inherit;
    opacity: 0.9;
}

/* Video */
.article-body .ql-video-wrapper {
    position: relative;
    margin: 1.5rem 0;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.article-body .ql-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Resizable Image */
.article-body .ql-image-resizable {
    position: relative;
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    text-align: center;
}

.article-body .ql-image-resizable img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.article-body mark {
    background: #fef08a;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.copyright-area {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.copyright-area a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.copyright-area a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.related-pages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.related-page-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.related-page-item:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.related-page-item h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 400;
}

.related-page-item p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* Butonlar */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Responsive */
@media (max-width: 1024px) {
    .article-body-wrapper {
        grid-template-columns: 1fr;
    }
    
    .table-of-contents {
        position: relative;
        top: 0;
        margin-top: 2rem;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .top-header {
        height: auto;
        padding: 0.5rem 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-center {
        width: 100%;
        max-width: 100%;
    }
    
    .header-right {
        width: 100%;
        justify-content: flex-end;
    }
    
    .docs-container {
        padding-top: calc(var(--header-height) + 60px);
    }
    
    .docs-sidebar {
        transform: translateX(-100%);
        top: calc(var(--header-height) + 60px);
        height: calc(100vh - var(--header-height) - 60px);
    }
    
    .docs-sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .docs-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .docs-article {
        padding: 1.5rem;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
}

/* Scrollbar */
.docs-sidebar::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.docs-sidebar::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
