﻿:root {
    --sidebar-width: 18%;
    --mobile-sidebar-width: 70%;
    --collapsed-width: 0;
    --transition-time: 0.3s;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 100vh;
    transition: grid-template-columns var(--transition-time);
}

.sidebar {
    background-color: #f4f4f4;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    transition: width var(--transition-time);
}

    .sidebar.hidden {
        width: var(--collapsed-width);
    }

    .sidebar .user-info {
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        border-bottom: 1px solid #ddd;
    }

        .sidebar .user-info h2 {
            margin: 10px 0 5px;
            font-size: 18px;
        }

        .sidebar .user-info p {
            margin: 0;
            font-size: 14px;
            color: #666;
        }

    .sidebar .menu {
        padding: 10px;
        flex-grow: 1;
    }

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

        .sidebar .menu li {
            margin: 5px 0;
        }

        .sidebar .menu a {
            display: block;
            padding: 10px;
            color: #333;
            text-decoration: none;
            background-color: #eaeaea;
            border-radius: 4px;
            cursor: pointer;
        }

            .sidebar .menu a:hover {
                background-color: #d0d0d0;
            }

        .sidebar .menu ul ul {
            margin-left: 15px;
            display: none;
        }

            .sidebar .menu ul ul.expanded {
                display: block;
            }

.content {
    padding: 20px;
    overflow-y: auto;
}

.toggle-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: calc(var(--sidebar-width) - 15px);
    z-index: 1000;
    padding: 5px 10px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s, left var(--transition-time);
}

    .toggle-btn:hover {
        background-color: #0056b3;
    }

.sidebar.hidden ~ .toggle-btn {
    left: 5px;
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: var(--mobile-sidebar-width);
    }

    .toggle-btn {
        left: calc(var(--sidebar-width) - 15px);
    }
}
