pixelcraft / frontend /src /styles /Sidebar.css
monumkp89's picture
Deploy PixelCraft web app
816c999 verified
Raw History Blame Contribute Delete
5.33 kB
/* Sidebar */
.sidebar {
width: 290px;
margin: 1.5rem 0 1.5rem 1.5rem;
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.2rem;
border-radius: 30px;
color: white;
background: linear-gradient(160deg, #14233a 0%, #17304d 48%, #1b4f6c 100%);
box-shadow: 0 28px 60px rgba(10, 18, 33, 0.22);
position: relative;
overflow: hidden;
transition: all 0.3s ease;
}
.sidebar-toggle {
position: absolute;
top: 12px;
right: 12px;
z-index: 10;
appearance: none;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
color: white;
cursor: pointer;
padding: 0.5rem;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}
.sidebar-toggle:hover {
background: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.3);
}
.sidebar.collapsed {
width: 60px;
margin: 1.5rem 0 1.5rem 1.5rem;
padding: 1rem 0.5rem;
align-items: center;
}
.sidebar.collapsed .sidebar-nav {
display: none;
}
.sidebar-header,
.sidebar-nav,
.logout-btn {
position: relative;
z-index: 1;
}
.sidebar-header,
.sidebar-nav,
.logout-btn {
position: relative;
z-index: 1;
}
.sidebar-header {
display: flex;
flex-direction: column;
gap: 0.35rem;
align-items: center;
}
.sidebar-toggle {
appearance: none;
border: 1px solid rgba(255, 255, 255, 0.16);
background: rgba(255, 255, 255, 0.09);
color: white;
cursor: pointer;
padding: 0.5rem;
border-radius: 12px;
font-size: 1rem;
font-weight: 700;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
}
.sidebar-toggle:hover {
background: rgba(255, 122, 89, 0.14);
border-color: rgba(255, 216, 204, 0.42);
}
.sidebar-kicker {
color: rgba(255, 203, 189, 0.95);
font-size: 0.76rem;
font-weight: 800;
letter-spacing: 0.18em;
text-transform: uppercase;
}
.sidebar-header h2 {
font-size: 1.8rem;
line-height: 1.02;
}
.sidebar-subtitle {
color: rgba(232, 242, 255, 0.8);
font-size: 0.95rem;
line-height: 1.5;
}
.sidebar-nav {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.nav-item,
.logout-btn {
appearance: none;
position: relative;
overflow: hidden;
isolation: isolate;
border-radius: 18px;
}
.nav-item::before,
.logout-btn::before {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, 0.22) 48%, transparent 82%);
transform: translateX(-120%);
transition: transform 0.55s ease;
pointer-events: none;
}
.nav-item:hover::before,
.logout-btn:hover::before,
.nav-item:focus-visible::before,
.logout-btn:focus-visible::before {
transform: translateX(120%);
}
.nav-item {
display: flex;
align-items: center;
justify-content: center;
gap: 0.95rem;
padding: 1rem;
border: 1px solid rgba(255, 255, 255, 0.12);
background: rgba(255, 255, 255, 0.08);
color: white;
cursor: pointer;
font-size: 0.98rem;
font-weight: 600;
text-align: left;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
transition: border-color 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease;
}
.nav-item:hover,
.nav-item:focus-visible {
border-color: rgba(255, 255, 255, 0.24);
background: rgba(255, 255, 255, 0.12);
box-shadow: 0 14px 28px rgba(7, 12, 24, 0.22);
}
.nav-item.active {
background: linear-gradient(135deg, rgba(255, 122, 89, 0.28) 0%, rgba(14, 165, 233, 0.16) 100%);
border-color: rgba(255, 208, 195, 0.46);
box-shadow: 0 18px 34px rgba(7, 12, 24, 0.26);
}
.icon {
min-width: 2.7rem;
padding: 0.42rem 0.48rem;
border-radius: 999px;
background: rgba(255, 255, 255, 0.14);
color: rgba(255, 243, 236, 0.95);
font-size: 0.72rem;
font-weight: 800;
letter-spacing: 0.06em;
text-align: center;
}
.logout-btn {
padding: 0.95rem 1rem;
border: 1px solid rgba(255, 255, 255, 0.16);
background: rgba(255, 255, 255, 0.09);
color: white;
cursor: pointer;
font-weight: 700;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
transition: border-color 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease;
display: flex;
align-items: center;
justify-content: center;
}
.logout-btn:hover,
.logout-btn:focus-visible {
border-color: rgba(255, 216, 204, 0.42);
background: rgba(255, 122, 89, 0.14);
box-shadow: 0 16px 28px rgba(7, 12, 24, 0.22);
}
@media (max-width: 768px) {
.sidebar {
width: auto;
margin: 1rem 1rem 0;
padding: 1rem;
border-radius: 24px;
}
.sidebar-header h2 {
font-size: 1.4rem;
}
.sidebar-subtitle {
font-size: 0.85rem;
}
.sidebar-nav {
flex-direction: row;
overflow-x: auto;
gap: 0.5rem;
padding-bottom: 0.5rem;
margin: 0 -0.5rem 0.5rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
-ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar {
display: none;
}
.nav-item {
min-width: max-content;
padding: 0.75rem 1rem;
font-size: 0.9rem;
white-space: nowrap;
flex-shrink: 0;
}
.icon {
min-width: 2rem;
padding: 0.35rem 0.4rem;
font-size: 0.65rem;
}
.logout-btn {
width: 100%;
margin-top: 0.5rem;
padding: 0.85rem 1rem;
}
}