frontend_nyla/src/components/Sidebar/SidebarStyles/Sidebar.module.css

182 lines
3.9 KiB
CSS

/* Allgemeine Stile */
.sidebarContainer {
border-radius: 0px;
background: var(--color-bg);
/*background-image: url('../../../styles/assets/bg.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
box-shadow: 0px 2px 6px 0px rgba(194, 194, 194, 0.10);*/
width: 250px;
padding: 0;
display: flex;
justify-content: flex-start;
align-items: stretch;
flex-direction: column;
height: 100vh;
max-height: 100vh;
overflow: hidden;
transition: width 0.3s ease-in-out;
position: relative;
z-index: 1;
box-sizing: border-box;
border-right: 1px solid var(--color-primary);
}
.sidebar {
display: flex;
flex-direction: column;
align-items: flex-start;
flex: 1;
min-height: 0;
font-family: var(--font-family);
overflow-y: auto;
overflow-x: hidden; /* Disable horizontal scrolling */
padding: 0;
margin: 0;
/* Ensure sidebar can scroll when content exceeds container */
/* flex: 1 makes it take available space, min-height: 0 allows it to shrink */
/* Content will expand naturally and trigger scrolling */
}
.sidebarContainer.minimized .sidebar {
overflow: visible !important;
}
.logoContainer {
display: flex;
height: 80px;
padding: 30px 20px 7px 27px;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
position: relative;
box-sizing: border-box;
}
.logoWrapper {
display: flex;
justify-content: left;
align-items: center;
opacity: 1;
transition: opacity 0.3s ease-in-out;
white-space: nowrap;
overflow: hidden;
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%); /* Center vertically - prevents jumping */
width: calc(100% - 90px); /* Full width minus button space */
}
.logo {
max-width: 80%;
height: auto;
color: var(--color-primary);
}
.logoText {
font-family: var(--font-family);
font-size: 35px;
display: flex;
align-items: center;
letter-spacing: -0.5px;
font-weight: 200;
}
.logoPower {
color: var(--color-text);
}
.logoOn {
color: var(--color-secondary);
font-weight: 700;
}
/* Toggle Button Styles */
.toggleButton {
background: none;
border: none;
border-radius: 10px;
color: var(--color-text);
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
flex-shrink: 0;
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
}
.toggleButton:hover {
background: none;
transform: scale(1.05);
top: 50%;
transform: translateY(-50%);
}
/* Minimized Sidebar Styles */
.sidebarContainer.minimized {
width: 80px;
overflow: visible !important;
}
.sidebarContainer.minimized .sidebar {
width: 80px;
align-items: center;
overflow: visible !important;
overflow-y: visible !important;
overflow-x: visible !important;
}
.sidebarContainer.minimized .logoContainer {
height: 80px;
padding: 15px 10px 7px 10px;
justify-content: center;
box-sizing: border-box;
}
.sidebarContainer.minimized .logoWrapper {
opacity: 0;
left: 20px; /* Keep same left position */
top: 50%;
transform: translateY(-50%); /* Keep same vertical centering */
}
.sidebarContainer.minimized .menuText {
opacity: 0; /* Same rule as logo - fade out when sidebar minimized */
}
.sidebarContainer.minimized .hassubmenu {
opacity: 0; /* Same rule as logo - fade out when sidebar minimized */
}
.sidebarContainer.minimized .text_content {
opacity: 0; /* Same rule as logo and menu text - fade out when sidebar minimized */
}
.sidebarContainer.minimized .toggleButton {
right: 15px; /* Center in 80px width: (80-50)/2 = 15px */
top: 50%;
transform: translateY(-50%); /* Keep same vertical centering */
}