/* Reset ve temel stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, 'Inter', Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    max-width: 100%;
    overflow-x: hidden;
}

  pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #d30001;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-image {
    height: 100%;
    width: auto;
    display: block; /* Küçük boşlukları (alt boşluk gibi) engeller. */
}


.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s;
    /* vertical-align: middle; */
    /* line-height:1.5rem; */
}

.nav a:hover {
    opacity: 0.8;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background-color: transparent;
  color: inherit;
  padding: 10px 16px;
  font-size: 1em;
  border: none;
  cursor: pointer;
  color: white;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dropbtn:hover {
  color: #f0f0f0;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #fff;
  width: 1050px; /* buradan daha fazla sütun eklenmesi için sayıyı değiştirebilirim*/
  max-width: 95vw; /*daha fazla sütun*/
  box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
}

.dropdown-content.multi-column {
  display: none;
  flex-wrap: wrap;
  gap: 30px;
}

.dropdown-column {
  flex: 1;
  min-width: 150px; /*bunları küçülterek sütunların sığmasını sağlayabiliriz*/
  max-width: 180px;
}

.dropdown-column h4 {
  color: #d30001; /* Rails kırmızısı */
  font-size: 0.85em;
  font-weight: 600;
  margin: 0 0 8px 0;
  padding: 4px 0;
  letter-spacing: 0.3px;
}

.dropdown-content a {
  color: #666;
  padding: 4px 0;
  text-decoration: none;
  display: block;
  font-size: 0.8em;
  transition: color 0.2s ease;
  margin: 1px 0;
  line-height: 1.4;
}

.dropdown-content a:hover {
  color: black;
  font-weight: bold;
}

/* Hover efekti - sadece buton hover olduğunda göster */
.dropdown:hover .dropdown-content {
  display: flex;
}

/* Dropdown açık kalması için hover alanını genişlet */
.dropdown:hover .dropdown-content.multi-column {
  display: flex;
}
/* Alternatif olarak menü tamamen hover yerine JavaScript ile toggle yapılabilir */
/* Header sonu */

/* Main content */
.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Guide layout */
.guide-container {
    /* display: grid; */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    /* grid-template-columns: 250px 1fr; */
    gap: 2rem;
    margin-top: 2rem;
    font-size: 1rem;
}

.guide-sidebar {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    /* height: fit-content; */
    max-height: calc(100vh - 40px); /* ekran boyutuna göre */
    height:fit-content;
    top: 2rem;
    overflow-y: auto; /* tek scroll alanı */
    font-size: 0.8rem;
    width: 250px;
    order: 2;
    position: sticky;
    /* margin-left: 20px; */
    }

.guide-sidebar h3 {
    color: #d30001;
    margin-bottom: 1rem;
    /* font-size: 1rem; */
}

#toc {
    max-height: calc(100vh - 250px); /* başlık ve alt menüye yer bırak */
    overflow-y: auto;
    padding-right: 4px;
}

/* İçindekiler aç/kapat butonu */
.toc-toggle {
  display: none;
  background-color: #d30001;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.toc-close{
    display: none;
}

.guide-toc ul {
    list-style: none;
    margin-bottom: 2rem;
    padding-left: 0;
}

.guide-toc li {
    margin-bottom: 0.5rem;
}

.guide-toc a {
    color: #666;
    text-decoration: none;
    /* font-size: 0.8rem; */
    display: block;
    padding: 0.25rem 0;
    /* transition: color 0.3s; */
    transition: font-weight 0.2s ease;
    line-height: 1.4;
    padding: 0.2rem 0;
}

.guide-toc a.active {
    color: #d30001;
    font-weight: bold;
}

.guide-toc a:hover {
    color: #d30001;
}

.guide-toc .toc-h3 {
    padding-left: 1rem;
}

.guide-toc .toc-h4 {
    padding-left: 2rem;
}

.guide-nav ul {
    list-style: none;
}

.guide-nav li {
    margin-bottom: 0.5rem;
}

.guide-nav a {
    color: #666;
    text-decoration: none;
    /* font-size: 0.9rem; */
    display: block;
    padding: 0.25rem 0;
    transition: color 0.3s;
}

.guide-nav a:hover {
    color: #d30001;
}

.guide-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex: 1;
    order: 1;

}

.guide-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
}

.guide-header h1 {
    color: #d30001;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.guide-description {
    font-size: 1.1rem;
    color: #666;
}

.guide-body h2 {
    color: #d30001;
    margin: 2rem 0 1rem 0;
    font-size: 1.8rem;
}

.guide-body h3 {
    color: #333;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.5rem;
}

.guide-body h4 {
    color: #333;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.3rem;
}

.guide-body h5 {
    color: #333;
    margin: 0.5rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.guide-body p {
    margin-bottom: 1rem;
    text-align: justify;
}

.guide-body ul, .guide-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.guide-body li {
    margin-bottom: 0.5rem;
}

.guide-body code {
    background: #f6f8fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #d30001;
}

.guide-body pre {
    background: #f6f8fa;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
    border-left: 4px solid #d30001;
}

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

.guide-body blockquote {
    border-left: 4px solid #d30001;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #666;
}

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

.guide-body th,
.guide-body td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}

.guide-body th {
    background: #f6f8fa;
    font-weight: bold;
}

.guide-alert {
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  display: flex;
  align-items: flex-start;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.guide-alert-icon {
  margin-right: 12px;
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.guide-alert-content {
  flex: 1;
  line-height: 1.5;
  margin-top: 4px;
}

.guide-alert-info {
  /* background-color: #0f2f3d; */
  /* background-color: #17a2b8; */
  background-color: rgba(15,47,61,0.9);
  border: 2px solid #17a2b8;
  color: #ffffff;
  margin-top: 4px;

}

.guide-alert-warning {
  background-color: rgba(61,47,15,0.9);
  border: 2px solid #ffc107;
  color: #ffffff;
  margin-top: 4px;

}

.guide-alert-success {
  background-color: #0f3d1a;
  border: 2px solid #28a745;
  color: #ffffff;
  margin-top: 4px;

}

.guide-alert-danger {
  background-color: #3d0f0f;
  border: 2px solid #dc3545;
  color: #ffffff;
  margin-top: 4px;
}

/* Ana sayfa linkleri */
.main h1 {
    color: #d30001;
    margin-bottom: 1rem;
}

.main h2 {
    color: #444;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.main ul {
    margin: 1rem 0;
}

.main li {
    margin-bottom: 0.5rem;
}

.main a {
    color: #d30001;
    text-decoration: none;
}

.main a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
    font-size: small;
}

.footer a {
    color: #d30001;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Geri bildirim */
.feedback {
    background: #f6f8fa;
    padding: 1.5rem;
    margin-top: 3rem;
    border-left: 4px solid #d30001;
    width: 100%;
    flex: 1;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 0.95rem;
}

.feedback h3 {
    color: #d30001;
    margin-bottom: 1rem;
}

.feedback p {
    margin-bottom: 0.8rem;
}

/* Yukarı Çık Butonu */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #d30001;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(211, 0, 1, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1001;
    font-size: 0;
}

.scroll-to-top:hover {
    background-color: #b50001;
    transform: translateY(0) scale(1.05);
    box-shadow: 0 6px 16px rgba(211, 0, 1, 0.4);
}

.scroll-to-top:active {
    transform: translateY(0) scale(0.95);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

@media (max-width: 1200px){
    .dropdown-content {
        width: 650px; /* buradan daha fazla sütun eklenmesi için sayıyı değiştirebilirim*/
        max-width: 95vw; /*daha fazla sütun*/
    }

    .dropdown-content.multi-column {
        gap: 15px;
    }

    .dropdown-column {
        flex: 1;
        min-width: 140px; /*bunları küçülterek sütunların sığmasını sağlayabiliriz*/
        max-width: 160px;
    }
}

/* Responsive */
@media (max-width: 768px) {

    .toc-toggle {
        display: block;
        align-self: flex-end;
        margin-left: auto;
    }

    .toc-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #d30001;
        position: absolute;
        top: 10px;
        right: 10px;
        cursor: pointer;
        display: block; /* Mobilde göster */;
    }


    .guide-container {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    
    .guide-sidebar {
        order: 2;
        /* position: static; */
        display: none; /* Mobilde gizle */;
        position: fixed; /* static idi*/
        top: 50%;
        right: 50%;
        width: 90%;
        transform: translate(50%, -50%); /* Ortala */
        height: auto;
        background: #f8f9fa;
        padding: 1.5rem;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /*
    .guide-sidebar {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    width: 90%;
    max-width: 320px;
    max-height: 90vh;
    height: auto;
    background: #f8f9fa;
    padding: 1.5rem 1rem 1rem 1rem;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    }
    */

    .guide-sidebar.open {
        display: block; /* Açıldığında göster */
    }
    
    .guide-content {
        width: 100%;
        padding: 1rem;

    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
  .dropdown-content {
    width: 95vw;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .dropdown-content.multi-column {
    flex-direction: column;
    gap: 15px;
  }
  
  .dropdown-column {
    min-width: 100%;
    max-width: 100%;
  }
    
    .guide-content {
        padding: 1rem;
    }
    
    .guide-header h1 {
        font-size: 2rem;
    }
    .feedback {
        width: 100%;
        font-size: 0.85rem;;
    }
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .scroll-to-top svg {
        width: 18px;
        height: 18px;
    }
    .guide-alert-content {
        font-size: 0.85rem;
    }
}

/* Çok küçük ekranlar için ek ayar */
@media (max-width: 480px) {
  .dropdown-content {
    width: 98vw;
    padding: 12px;
  }
  
  .dropdown-column h4 {
    font-size: 0.8em;
  }
  
  .dropdown-content a {
    font-size: 0.75em;
  }
  .scroll-to-top {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    }
    
    .scroll-to-top svg {
    width: 16px;
    height: 16px;
    }
}