/* CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--second-page-bg-color)
}

/* Layout */
.test {
    position: relative;
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
    margin-left: var(--sidebar-width);
    overflow: hidden;
}

/* Logo and Search Container */
.logo-search-container {
    position: fixed;
    display: flex;
    top: 0;
    left: var(--sidebar-width);
    min-height: 75px;
    right: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 20px;
    width: calc(100% - var(--sidebar-width));
    z-index: 999;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.logo-search-container.scrolled {
    background-color: var(--sidebar-bg-color);
}

/* Sidebar toggle for mobile */
.sidebar-toggle {
    display: none;
    position: absolute;
    left: 10px;
    z-index: 1000;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
}
/* Logo */
.logo {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    padding: 10px 15px;
    background-color: var(--sidebar-bg-color);
    border-radius: 10px;
    z-index: 1000;
    cursor: pointer;
    text-wrap: nowrap;
    text-decoration: none;
}

.logo.scrolled {
    background-color: transparent;
    box-shadow: none;
}

.logo:hover {
    background-color: var(--logo-hover-bg);
    box-shadow: 0 4px 10px var(--logo-hover-shadow);
}

.logo.scrolled:hover {
    background-color: var(--logo-hover-bg);
    box-shadow: 0 4px 10px var(--logo-hover-shadow);
}

.logo .logo-text {
    color: var(--secondary-color);
    transition: color 0.3s ease;
}
  
.logo .logo-highlight {
    color: var(--primary-color);
    transition: color 0.3s ease;
}
  
.logo:hover .logo-text {
    color: var(--background-color);
}
  
.logo:hover .logo-highlight {
    color: var(--secondary-color);
}

/* Search Bar */
.search-bar {
    display: flex;
    width: 30%;
    height: 3em;
    transition: width 0.4s var(--transition-ease);
    z-index: 1000;
}

.search-bar.focused {
    width: 40%;
}

.search-bar input[type="text"] {
    width: 100%;
    color: var(--search-input-text);
    padding: 1em;
    border: 1px solid var(--search-input-border);
    border-radius: 30px 0 0 30px;
    font-size: 1em;
    background-color: var(--search-input-bg);
    transition: border-color var(--transition-duration) var(--transition-ease),
                width 0.4s var(--transition-ease);
    outline: none;
    box-shadow: 0 2px 4px var(--search-shadow);
}

.search-bar input[type="text"]:focus {
    border-color: var(--primary-color);
}

.search-bar button {
    padding: 0.5em 1em;
    border: none;
    background-color: var(--search-button-bg);
    color: #ffffff;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    transition: background-color var(--transition-duration) var(--transition-ease);
    z-index: 1001;
}

.search-bar button:hover {
    background-color: var(--search-button-hover);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: none;
    z-index: 999;
    transition: opacity 0.4s var(--transition-ease);
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Media Queries */
@media (max-width: 1024px) {
    .logo-search-container {
        width: 100%;
        left: 0;
        padding: 8px 10px;
        min-height: 70px;
    }
    
    .test {
        margin-left: 0;
        justify-content: center;
        overflow: visible;
        width: 100%;
    }
    
    .logo {
        font-size: 1.6em;
        padding: 9px;
    }
    
    .search-bar {
        width: 14.5em;
        height: 2.5em;
    }

    .search-bar input[type="text"],
    .search-bar button {
        height: 100%;
        padding: 0 0.5em;
        font-size: 0.9em;
    }

    .search-bar.focused {
        width: 17em;
    }
}

@media (max-width: 768px) {
    
    .test {
        margin-left: 0;
        justify-content: center;
        overflow: visible;
        width: 100%;
    }
    
    .logo {
        top: 8px;
        padding: 8px;
        font-size: 1.6em;
    }
    
    .search-bar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        overflow: hidden;
        transition: all 0.3s ease;
        right: 10px;
        z-index: 1005;
    }

    .search-bar.expanded {
        width: 100%;
        height: 50px;
        border-radius: 25px;
        z-index: 1001;
    }

    .search-bar input[type="text"] {
        width: calc(100% - 40px);
        padding: 0;
        opacity: 0;
        transition: all 0.3s ease;
        border-radius: 20px 0 0 20px;
    }

    .search-bar.expanded input[type="text"] {
        padding: 0 15px;
        opacity: 1;
    }

    .search-bar button {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .search-bar.expanded button {
        width: 50px;
        height: 50px;
        border-radius: 0 25px 25px 0;
    }
}

@media (max-width: 380px) {
    .logo-search-container{
        min-height: 65px;
    }

    .logo {
        font-size: 1.4em;
        padding: 8px 12px;
        top: 7px;
    }
}