/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #85372d;
    --primary-dark: #85372d;
    --primary-light: #85372d;
    --secondary-color: #85372d;
    --accent-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #2d3748;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --sidebar-width: 280px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-size: 14px;
    font-weight: 500;
}

.skip-link:focus {
    top: 6px;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-primary);
}

.sidebar-logo i {
    font-size: 1.25rem;
}

.sidebar-logo .logo-image {
    height: 3rem;
    width: auto;
    margin-right: 0.5rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0.5rem 0;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-link:hover,
.nav-link:focus {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary-light);
    outline: none;
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    border-left-color: var(--accent-color);
}

.nav-link i {
    width: 1.25rem;
    text-align: center;
    opacity: 0.8;
}

/* Special style for show-all link */
.nav-link.show-all {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.25rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.show-all:hover,
.nav-link.show-all:focus {
    background: rgba(255, 255, 255, 0.15);
}

.nav-link.show-all.active {
    background: var(--primary-color);
    font-weight: 600;
}

/* Navigation separator */
.nav-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 1.25rem;
    list-style: none;
}

/* External link style */
.nav-link.external-link {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.nav-link.external-link:hover,
.nav-link.external-link:focus {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.external-link i {
     color: white;
}

/* TTKB Logo Footer */
.sidebar-logo-footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: var(--sidebar-width);
    padding: 1rem;
    text-align: center;
    z-index: 1001;
}

.ttkb-logo {
    width: 100px;
    height: auto;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.ttkb-logo:hover {
    opacity: 1;
}

/* Main Container */
.main-container {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: var(--bg-primary);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Header - Minimalist */
.header {
    background: var(--bg-dark);
    color: white;
    padding: 0.75rem 0; /* Daha da küçültüldü */
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.main-title {
    font-size: 1.25rem; /* Daha da küçültüldü */
    font-weight: 600; /* 700'den 600'e düşürüldü */
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
    white-space: nowrap;
}

.main-title i {
    font-size: 1.25rem; /* Daha da küçültüldü */
    color: white;
}

.subtitle {
    font-size: 1 rem; /* Daha da küçültüldü */
    opacity: 1;
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.3;
}

.title-section {
    flex: 0 0 auto; /* Flex büyümesini engelle */
    min-width: 0;
}

/* Search Container - Kompakt */
.search-container {
    position: relative;
    width: 100%;
    max-width: 350px; /* 400px'den küçültüldü */
    flex: 1;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 9999px; /* Tam yuvarlak */
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.search-box:focus-within {
    box-shadow: var(--shadow-xl);
    transform: translateY(-1px);
    border-color: var(--accent-color);
}

.search-icon {
    position: absolute;
    left: 0.875rem; /* 1rem'den küçültüldü */
    color: var(--text-light);
    font-size: 0.875rem; /* 1rem'den küçültüldü */
    z-index: 2;
}

#searchInput {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem; /* Padding küçültüldü */
    border: none;
    outline: none;
    font-size: 16px; /* Mobil zoom önlemek için 16px */
    color: var(--text-primary);
    background: transparent;
    border-radius: 9999px;
    touch-action: manipulation;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#searchInput::placeholder {
    color: var(--text-light);
}

.clear-btn {
    position: absolute;
    right: 0.5rem;
    background: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 1.5rem; /* 1.75rem'den küçültüldü */
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.7rem; /* 0.75rem'den küçültüldü */
}

.clear-btn:hover {
    background: var(--text-secondary);
    transform: scale(1.1);
}

/* Search Results - Güncellenmiş */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.5rem;
    display: none;
    border: 1px solid var(--border-color);
}

.search-result-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--bg-tertiary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.search-result-content {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.search-highlight {
    background-color: #fecaca;
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--primary-dark);
}

/* Content - Kompakt */
.content {
    padding: 1.5rem; /* 2rem'den küçültüldü */
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    flex: 1;
}

.content-section {
    margin-bottom: 2.5rem; /* 4rem'den küçültüldü */
    scroll-margin-top: 80px; /* Header yüksekliği azaldığı için güncellendi */
}

.section-title {
    font-size: 1.5rem; /* 2rem'den küçültüldü */
    font-weight: 600; /* 700'den küçültüldü */
    color: white;
    margin-bottom: 1rem; /* 1.5rem'den küçültüldü */
    padding: 0.75rem 1rem; /* 1rem 1.5rem'den küçültüldü */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.section-intro {
    font-size: 1rem; /* 1.125rem'den küçültüldü */
    color: var(--text-secondary);
    margin-bottom: 1.5rem; /* 2rem'den küçültüldü */
    padding: 1rem; /* 1.5rem'den küçültüldü */
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
}

/* Definition Grid */
.definition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.definition-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
}

.definition-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.definition-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.definition-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Subsections - Minimalist */
.subsection {
    margin-bottom: 1.5rem; /* 2rem'den küçültüldü */
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 3;
}

.subsection-title {
    font-size: 1.125rem; /* 1.5rem'den küçültüldü */
    font-weight: 600;
    color: white;
    background: #877e83; /* Açık kırmızı arka plan */
    padding: 0.75rem 1rem; /* 1.5rem'den küçültüldü */
    margin: 0;
}

/* Criteria - Kompakt */
.criterion {
    padding: 1rem; /* 1.5rem'den küçültüldü */
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem; /* 1rem'den küçültüldü */
    
    background: #f8f9fa; /* Açık gri arka plan */
    
    border-left: 4px solid #877e83; /* Sol çizgi rengi subsection-title ile aynı */

    position: relative;
    margin-bottom: 1px; /* Aralarında ince boşluk */
}

.criterion:last-child {
    border-bottom: none;
}

.criterion-number {
    font-size: 1rem; /* 1.125rem'den küçültüldü */
    font-weight: 700;
    color: var(--primary-color);
    min-width: 3.5rem; /* 4rem'den küçültüldü */
    flex-shrink: 0;
    margin: 0;
}

.criterion-content {
    flex: 1;
}

.criterion-text {
    color: #475569    ;
    margin-bottom: 0.75rem; /* 1rem'den küçültüldü */
    font-weight: 500;
    line-height: 1.5; /* 1.6'dan küçültüldü */
    font-size: 0.95rem; /* Biraz küçültüldü */
    font-weight: bold;
}

.criterion-details {
    list-style: none;
    padding-left: 0;
}

.criterion-details li {
    position: relative;
    padding-left: 1.25rem; /* 1.5rem'den küçültüldü */
    margin-bottom: 0.5rem; /* 0.75rem'den küçültüldü */
    color: var(--text-secondary);
    line-height: 1.5; /* 1.6'dan küçültüldü */
    font-size: 0.9rem; /* Biraz küçültüldü */
}

.criterion-details li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1rem;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.footer-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-primary);
}

.footer-info p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.footer-info a {
    color: var(--primary-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-info a:hover {
    color: white;
}

.footer-note {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-light);
}

.footer-note p {
    margin: 0;
    font-style: italic;
    line-height: 1.6;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 250px;
    }
    
    .main-title {
        font-size: 1.125rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .search-container {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 100vw;
        max-width: 320px;
        will-change: transform;
        z-index: 1001;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-container {
        margin-left: 0;
        width: 100%;
    }
    
    .header {
        padding: 0.5rem 0;
        padding-left: 60px; /* Hamburger menu için alan bırak */
    }
    
    .header-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .main-title {
        font-size: 1rem;
        text-align: center;
        gap: 0.5rem;
        line-height: 1.3;
    }
    
    .subtitle {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .search-container {
        order: 1;
        margin-top: 0.5rem;
    }
    
    .search-box {
        padding: 0.5rem;
    }
    
    #searchInput {
        padding: 0.5rem 0.75rem 0.5rem 2.25rem;
        font-size: 16px; /* Mobil zoom önlemek için 16px */
    }
    
    .search-icon {
        left: 0.75rem;
        font-size: 0.875rem;
    }
    
    .content {
        padding: 0.75rem;
    }
    
    .section-title {
        font-size: 1.125rem;
        padding: 0.625rem 0.875rem;
        text-align: center;
    }
    
    .subsection-title {
        font-size: 1rem;
        padding: 0.625rem 0.875rem;
        text-align: center;
    }
    
    .definition-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .definition-item {
        padding: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .criterion {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.875rem;
    }
    
    .criterion-number {
        min-width: auto;
        font-size: 0.95rem;
    }
    
    .criterion-text {
        font-size: 0.9rem;
    }
    
    .criterion-details li {
        font-size: 0.85rem;
        padding-left: 1rem;
    }
    
    .criterion-details li::before {
        content: "•";
        position: absolute;
        left: 0;
        color: var(--primary-color);
        font-weight: bold;
        font-size: 0.9rem;
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .nav-link i {
        width: 1.5rem;
        font-size: 1rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.375rem 0;
        padding-left: 55px; /* Hamburger menu için alan bırak */
    }
    
    .mobile-menu-toggle {
        top: 0.75rem;
        left: 0.75rem;
    }
    
    .main-title {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 0.75rem;
    }
    
    .search-box {
        margin: 0;
    }
    
    #searchInput {
        padding: 0.45rem 0.625rem 0.45rem 2rem;
        font-size: 16px; /* Mobil zoom önlemek için 16px */
    }
    
    .search-icon {
        left: 0.625rem;
        font-size: 0.8rem;
    }
    
    .clear-btn {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.625rem;
    }
    
    .content {
        padding: 0.5rem;
    }
    
    .section-title {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .subsection-title {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .definition-item,
    .criterion {
        padding: 0.75rem;
    }
    
    .criterion-number {
        font-size: 0.9rem;
    }
    
    .criterion-text {
        font-size: 0.85rem;
    }
    
    .criterion-details li {
        font-size: 0.8rem;
        padding-left: 0.875rem;
    }
    
    .criterion-details li::before {
        content: "•";
        position: absolute;
        left: 0;
        color: var(--primary-color);
        font-weight: bold;
        font-size: 0.65rem;
    }
    
    .nav-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-logo {
        font-size: 1.125rem;
    }
    
    .sidebar-logo-footer {
        display: none;
    }
    
    .back-to-top {
        bottom: 0.75rem;
        right: 0.75rem;
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1002;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
    background: var(--primary-dark);
    transform: translateY(-2px);
    outline: 2px solid white;
    outline-offset: 2px;
}

.mobile-menu-toggle:active {
    transform: translateY(0);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .sidebar.open ~ .sidebar-overlay {
        display: block;
        opacity: 1;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Optimize scrolling on mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: auto;
    }
    
    .content-section {
        scroll-margin-top: 60px;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    animation: fadeIn 0.6s ease-out;
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .footer,
    .back-to-top,
    .mobile-menu-toggle {
        display: none;
    }
    
    .main-container {
        margin-left: 0;
    }
    
    .content {
        padding: 0;
        max-width: none;
    }
    
    .content-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

