/* Ensure padding doesn't affect width calculations */
* {
    box-sizing: border-box;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #DA7757; 
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes the menu toggle to the right */
    z-index: 1001; /* Keeps header above the sliding sidebar */
}

header img {
    height: 30px;
    margin-right: 10px;
}

header h1 {
    margin: 0;
    font-size: 1.2rem;
    color: #FFFFFF;
}

body {
    margin: 0;
    margin-top: 60px; /* Header'ın üstünü kapatmaması için */
    background-color: #F2E9D7;
    font-family: "Georgia", serif;
}

.header-brand {
    text-decoration: none; 
    color: inherit;       
    display: flex;        
    align-items: center;
}

/* Mobile Toggle Button (Hidden on Desktop) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.5rem;
    cursor: pointer;
}

.main-container {
    display: flex;
    height: calc(100vh - 60px); 
}

.sidebar {
    width: 250px;
    background-color:  #f0e1c4;
    overflow-y: auto; 
    padding: 20px;
    border-radius: 15px;
    transition: transform 0.3s ease; /* Smooth slide animation */
}

.sidebar h3 {
    margin-top: 0;
    border-bottom: 1px solid #DA7757;
    padding-bottom: 10px; 
    margin-bottom: 15px; 
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    padding: 10px 0;
}

.content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    min-width: 0; 
}

.search-container input {
    width: 100%;
    padding: 10px;
    background-color: #f0e1c4;
    border: none;
    outline: none;
    margin-bottom: 20px;
    border-radius: 10px;
    font-family: inherit; 
    font-size: 1rem; 
}

.search-container input::placeholder {
    color: rgba(0,0,0,0.5);
}

.api-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.api-table td {
    padding: 15px 10px;
    position: relative; 
    border-bottom: none; 
}

.api-table td::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px; 
    background-color: #DA7757;
    border-radius: 10px; 
}

.dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
}

.red { background-color: #e74c3c; }
.yellow { background-color: #f1c40f; }
.green { background-color: #2ecc71; }

/* --- RESPONSIVE MEDIA QUERIES --- */

/* PC/Büyük Ekranlar İçin */
@media (min-width: 768px) {
    header {
        padding: 10px 1%; 
    }
    
    .sidebar {
        margin: 1px 0 10px 10px; /* Adds space to top, bottom, and left */
    }
}

/* Küçük Ekranlar/Mobil İçin */
@media (max-width: 767px) {
    header {
        padding: 10px 20px;
    }

    /* Show hamburger icon */
    .mobile-menu-btn {
        display: block;
    }

    /* Turn sidebar into a sliding overlay */
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        z-index: 1000;
        transform: translateX(-100%); /* Hidden off-screen by default */
        border-radius: 0 15px 15px 0; /* Flat left side, rounded right side */
        box-shadow: 4px 0 10px rgba(0,0,0,0.1); /* Adds depth so it looks like a menu overlay */
    }

    /* JavaScript toggles this class to slide it in */
    .sidebar.active {
        transform: translateX(0); 
    }

    /* Prevents the table from squishing on tiny phones */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
    }

    .api-table {
        min-width: 600px;
    }
}

/* Hide scrollbar for the table but keep functionality */
.table-responsive::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.table-responsive {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Table Header Styling */
.api-table th {
    text-align: left;
    padding: 10px;
    color: #DA7757;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-bottom: 2px solid #DA7757; /* Solid line for the header */
}

/* Adjust data cells to remove the relative underline if you want a cleaner look */
.api-table td {
    padding: 15px 10px;
    border-bottom: 1px solid rgba(218, 119, 87, 0.3); /* Lighter line for rows */
}

/* Remove the pseudo-element underline if using the border-bottom above */
.api-table td::after {
    display: none; 
}

/* Container for Brand and GitHub */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px; /* Space between Title and GitHub Icon */
}

.github-link {
    color: #FFFFFF;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.github-link:hover {
    opacity: 0.8;
}

/* Ensure the burger menu stays far right */
header {
    justify-content: space-between;
}

/* Sidebar Category Styling */
.cat-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    margin-bottom: 5px;
}

.cat-item:hover {
    background-color: rgba(218, 119, 87, 0.1);
}

/* The Toggle Box (The "Checkbox" visual) */
.toggle-box {
    width: 18px;
    height: 18px;
    border: 2px solid #DA7757;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s;
}

/* When active: fill the box */
.cat-item.active .toggle-box {
    background-color: #DA7757;
}

/* Add a checkmark or dot inside when active */
.cat-item.active .toggle-box::after {
    content: "✓";
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cat-item.active {
    font-weight: bold;
    color: #DA7757;
}

/* Specific button/link styles for the table */
.url-link {
    color: #DA7757; 
    text-decoration: none; 
    font-weight: bold;
}

.copy-btn {
    margin-left: 8px; 
    cursor: pointer; 
    background: #DA7757; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    padding: 2px 6px; 
    font-size: 0.8rem;
}