gaialive's picture
Upload Sidebar.css
e2a9e58 verified
/* Sidebar Component Styles */
.terra-sidebar {
position: fixed;
left: 0;
top: 0;
height: 100vh;
background: #2E7D32;
color: white;
transition: width 0.3s ease;
display: flex;
flex-direction: column;
z-index: 1000;
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
overflow: hidden; /* Keep overflow hidden for smooth width transition */
}
.terra-sidebar--open {
width: 280px;
}
.terra-sidebar--closed {
width: 70px;
}
/* Header Section */
.terra-sidebar__header {
padding: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
display: flex;
align-items: center;
justify-content: space-between;
min-height: 80px;
}
.terra-sidebar__logo {
display: flex;
align-items: center;
gap: var(--spacing-md);
flex: 1;
min-width: 0;
}
.terra-sidebar__logo-icon {
font-size: 2.5rem;
animation: gentle-pulse 3s ease-in-out infinite;
flex-shrink: 0;
}
@keyframes gentle-pulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
}
.terra-sidebar__logo-text {
min-width: 0;
opacity: 1;
transition: opacity var(--transition-normal);
}
.terra-sidebar--closed .terra-sidebar__logo-text {
opacity: 0;
pointer-events: none;
}
.terra-sidebar__logo-title {
font-size: 1.4rem;
font-weight: 700;
margin: 0 0 4px 0;
color: white;
white-space: nowrap;
}
.terra-sidebar__logo-subtitle {
font-size: 0.8rem;
color: rgba(255, 255, 255, 0.8);
margin: 0;
white-space: nowrap;
}
.terra-sidebar__toggle {
background: rgba(255, 255, 255, 0.2);
border: none;
color: white;
width: 32px;
height: 32px;
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
font-size: 0.9rem;
}
.terra-sidebar__toggle:hover {
background: rgba(255, 255, 255, 0.25);
transform: scale(1.05);
}
.terra-sidebar__toggle:focus {
outline: none;
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.terra-sidebar__toggle-icon {
transition: transform var(--transition-normal);
}
.terra-sidebar__toggle-icon--open {
transform: rotate(180deg);
}
/* Search Section */
.terra-sidebar__search {
padding: 0 var(--spacing-lg) var(--spacing-lg);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.terra-sidebar__search-container {
position: relative;
display: flex;
align-items: center;
}
.terra-sidebar__search-input {
width: 100%;
padding: var(--spacing-sm) var(--spacing-md);
padding-right: 2.5rem;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: var(--radius-md);
color: var(--color-white);
font-size: var(--font-size-sm);
transition: all var(--transition-normal);
}
.terra-sidebar__search-input::placeholder {
color: rgba(255, 255, 255, 0.6);
}
.terra-sidebar__search-input:focus {
outline: none;
background: rgba(255, 255, 255, 0.15);
border-color: var(--color-mint-light);
box-shadow: 0 0 0 2px rgba(168, 230, 163, 0.3);
}
.terra-sidebar__search-icon {
position: absolute;
right: var(--spacing-sm);
color: rgba(255, 255, 255, 0.6);
font-size: var(--font-size-sm);
}
.terra-sidebar__search-clear {
background: none;
border: none;
color: rgba(255, 255, 255, 0.6);
cursor: pointer;
padding: var(--spacing-xs);
border-radius: var(--radius-sm);
transition: all var(--transition-normal);
}
.terra-sidebar__search-clear:hover {
color: var(--color-white);
background: rgba(255, 255, 255, 0.1);
}
/* Navigation Section */
.terra-sidebar__nav {
flex: 1;
overflow-y: auto;
padding: var(--spacing-md) 0;
}
.terra-sidebar__nav::-webkit-scrollbar {
width: 4px;
}
.terra-sidebar__nav::-webkit-scrollbar-track {
background: transparent;
}
.terra-sidebar__nav::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 2px;
}
.terra-sidebar__nav::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.5);
}
.terra-sidebar__nav-content {
display: flex;
flex-direction: column;
gap: var(--spacing-lg);
}
.terra-sidebar__category {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
}
.terra-sidebar__category-title {
font-size: var(--font-size-xs);
font-weight: var(--font-weight-semibold);
color: rgba(255, 255, 255, 0.7);
text-transform: uppercase;
letter-spacing: 0.5px;
margin: 0;
padding: 0 var(--spacing-lg);
}
.terra-sidebar__category-items {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
}
.terra-sidebar__nav-item {
display: flex;
align-items: center;
padding: 12px 16px;
margin: 2px 12px;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
min-height: 48px;
}
.terra-sidebar__nav-item:hover {
background: rgba(255, 255, 255, 0.1);
transform: translateX(4px);
}
.terra-sidebar__nav-item:focus {
outline: none;
background: rgba(255, 255, 255, 0.15);
box-shadow: 0 0 0 2px rgba(168, 230, 163, 0.3);
}
.terra-sidebar__nav-item--active {
background: rgba(255, 255, 255, 0.2);
transform: translateX(4px);
}
.terra-sidebar__nav-item--active::before {
content: '';
position: absolute;
left: -12px;
top: 0;
bottom: 0;
width: 4px;
background: #4CAF50;
border-radius: 0 2px 2px 0;
}
.terra-sidebar__nav-icon {
font-size: 1.5rem;
margin-right: var(--spacing-md);
min-width: 28px;
text-align: center;
flex-shrink: 0;
}
.terra-sidebar__nav-content {
flex: 1;
min-width: 0;
opacity: 1;
transition: opacity var(--transition-normal);
}
.terra-sidebar--closed .terra-sidebar__nav-content {
opacity: 0;
pointer-events: none;
}
.terra-sidebar__nav-name {
font-weight: var(--font-weight-semibold);
font-size: var(--font-size-sm);
display: block;
margin-bottom: var(--spacing-xs);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.terra-sidebar__nav-desc {
font-size: var(--font-size-xs);
opacity: 0.8;
color: #b8e6b3;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.terra-sidebar__nav-indicator {
position: absolute;
right: var(--spacing-md);
width: 6px;
height: 6px;
background: var(--color-mint-light);
border-radius: 50%;
animation: pulse 2s infinite;
}
/* Footer Section */
.terra-sidebar__footer {
padding: var(--spacing-lg);
border-top: 1px solid rgba(255, 255, 255, 0.15);
display: flex;
flex-direction: column;
gap: var(--spacing-md);
}
.terra-sidebar__stats {
display: flex;
gap: var(--spacing-md);
}
.terra-sidebar__stat {
display: flex;
align-items: center;
gap: var(--spacing-sm);
flex: 1;
}
.terra-sidebar__stat-icon {
font-size: 1.3rem;
flex-shrink: 0;
}
.terra-sidebar__stat-content {
min-width: 0;
}
.terra-sidebar__stat-value {
font-weight: var(--font-weight-bold);
font-size: var(--font-size-sm);
white-space: nowrap;
}
.terra-sidebar__stat-label {
font-size: var(--font-size-xs);
opacity: 0.8;
white-space: nowrap;
}
.terra-sidebar__version {
text-align: center;
font-size: var(--font-size-xs);
opacity: 0.6;
color: #b8e6b3;
}
/* Language Selector and Version (always visible) */
.terra-sidebar__bottom-section {
padding: var(--spacing-lg);
border-top: 1px solid rgba(255, 255, 255, 0.15);
display: flex;
flex-direction: column;
gap: var(--spacing-md);
margin-top: auto; /* Pushes it to the bottom */
}
.terra-sidebar--closed .terra-sidebar__bottom-section {
padding: var(--spacing-md) var(--spacing-sm); /* Adjust padding for collapsed state */
align-items: center; /* Center items when collapsed */
}
.terra-sidebar__language-selector-container {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
width: 100%; /* Ensure it takes full width */
}
.terra-sidebar--closed .terra-sidebar__language-selector-container {
flex-direction: column; /* Keep column layout for selector */
align-items: center; /* Center content */
}
.terra-sidebar__language-label {
font-size: var(--font-size-xs);
opacity: 0.8;
color: rgba(255, 255, 255, 0.7);
text-align: center; /* Center label */
}
.terra-sidebar--closed .terra-sidebar__language-label {
display: none; /* Hide label when collapsed to save space */
}
.terra-sidebar__language-select {
width: 100%;
padding: var(--spacing-xs) var(--spacing-sm);
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: var(--radius-md);
color: white;
font-size: var(--font-size-sm);
cursor: pointer;
appearance: none; /* Remove default select arrow */
-webkit-appearance: none;
-moz-appearance: none;
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292%22%20height%3D%22292%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M287%2C197L146%2C56L5%2C197H287z%22%2F%3E%3C%2Fsvg%3E'); /* Custom arrow */
background-repeat: no-repeat;
background-position: right 8px top 50%;
background-size: 12px auto;
}
.terra-sidebar--closed .terra-sidebar__language-select {
width: 40px; /* Make it smaller when collapsed */
height: 40px; /* Make it square */
border-radius: 50%; /* Make it circular */
padding: 0; /* Remove padding */
text-align: center; /* Center content */
background-position: center; /* Center arrow */
font-size: 0; /* Hide text */
overflow: hidden; /* Hide overflow */
display: flex; /* Use flex for centering */
justify-content: center; /* Center content */
align-items: center; /* Center content */
}
.terra-sidebar--closed .terra-sidebar__language-select option {
display: none; /* Hide options when collapsed */
}
.terra-sidebar--closed .terra-sidebar__language-select::before {
content: "🌐"; /* Show globe icon when collapsed */
font-size: 1.5rem; /* Size of the globe icon */
color: white; /* Color of the globe icon */
display: block; /* Make sure it's visible */
}
.terra-sidebar__language-select:focus {
outline: none;
border-color: var(--color-mint-light);
box-shadow: 0 0 0 2px rgba(168, 230, 163, 0.3);
}
/* Tooltip for collapsed state */
.terra-sidebar__tooltip {
position: fixed;
left: 80px;
background: var(--color-gray-800);
color: var(--color-white);
padding: var(--spacing-sm) var(--spacing-md);
border-radius: var(--radius-sm);
font-size: var(--font-size-sm);
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity var(--transition-normal);
z-index: var(--z-tooltip);
box-shadow: var(--shadow-lg);
}
.terra-sidebar__tooltip-arrow {
position: absolute;
left: -4px;
top: 50%;
transform: translateY(-50%);
width: 0;
height: 0;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-right: 4px solid var(--color-gray-800);
}
/* Responsive Design */
@media (max-width: 1024px) {
.terra-sidebar {
transform: translateX(-100%);
transition: transform var(--transition-bounce);
border-radius: 0;
}
.terra-sidebar--open {
transform: translateX(0);
width: 280px;
}
.terra-sidebar--closed {
transform: translateX(-100%);
}
}
@media (max-width: 640px) {
.terra-sidebar--open {
width: 100vw;
}
.terra-sidebar__header {
padding: var(--spacing-md);
}
.terra-sidebar__search {
padding: 0 var(--spacing-md) var(--spacing-md);
}
.terra-sidebar__nav-item {
padding: var(--spacing-md);
margin: 0 var(--spacing-sm);
}
.terra-sidebar__footer {
padding: var(--spacing-md);
}
}
/* High Contrast Mode */
@media (prefers-contrast: high) {
.terra-sidebar {
background: var(--color-forest-deep);
border-right: 2px solid var(--color-white);
}
.terra-sidebar__nav-item--active {
background: rgba(255, 255, 255, 0.3);
border: 1px solid var(--color-white);
}
}
/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
.terra-sidebar,
.terra-sidebar__toggle-icon,
.terra-sidebar__nav-item,
.terra-sidebar__logo-text,
.terra-sidebar__nav-content {
transition: none;
}
.terra-sidebar__logo-icon {
animation: none;
}
.terra-sidebar__nav-indicator {
animation: none;
}
.terra-sidebar__nav-item:hover {
transform: none;
}
}
/* Focus Management */
.terra-sidebar__nav-item:focus-visible {
outline: 2px solid var(--color-mint-light);
outline-offset: 2px;
}
/* Animation for nav items */
.terra-sidebar__nav-item {
animation: slideInLeft 0.3s ease-out;
animation-fill-mode: both;
}
.terra-sidebar__nav-item:nth-child(1) { animation-delay: 0.1s; }
.terra-sidebar__nav-item:nth-child(2) { animation-delay: 0.15s; }
.terra-sidebar__nav-item:nth-child(3) { animation-delay: 0.2s; }
.terra-sidebar__nav-item:nth-child(4) { animation-delay: 0.25s; }
.terra-sidebar__nav-item:nth-child(5) { animation-delay: 0.3s; }
@keyframes slideInLeft {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
}
}