/* app/styles/components/sidebars.css */

/* Symmetrical Right Sidebar Navigation */
#right-sidebar-nav {
    width: var(--sidebar-width);
    background-color: var(--md-sys-color-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--md-sys-spacing-4);
    flex-shrink: 0;
    transition: width 0.2s ease;
    border-left: 1px solid var(--md-sys-color-outline);
    overflow: hidden;
    z-index: 5;
}

#right-sidebar-nav .sidebar-items-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    flex: 1;
}

#right-sidebar-nav .sidebar-items-container::-webkit-scrollbar {
    display: none;
}

#right-sidebar-nav .sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--md-sys-spacing-4) 0;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.6;
    width: 100%;
    color: var(--md-sys-color-on-surface);
    transition: opacity 0.2s, border-right-color 0.2s, background-color 0.2s;
    border-right: 3px solid transparent;
    box-sizing: border-box;
}

#right-sidebar-nav .sidebar-item.right-tab {
    flex: none !important;
    border-bottom: none !important;
    text-transform: none !important;
    font-weight: 500 !important;
    background: transparent !important;
}

#right-sidebar-nav .sidebar-item.right-tab.active {
    border-bottom-color: transparent !important;
    background-color: var(--md-sys-color-surface-hover) !important;
}

#right-sidebar-nav .sidebar-item:hover, 
#right-sidebar-nav .sidebar-item.active {
    opacity: 1;
    border-right-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-surface-hover) !important;
}

#right-sidebar-nav.expanded .sidebar-item {
    justify-content: flex-start;
    padding-left: 10px;
}

#right-sidebar-nav.expanded {
    width: var(--sidebar-expanded-width);
    align-items: stretch;
}

#right-sidebar-nav.expanded .sidebar-label {
    display: block;
}

#right-sidebar-nav .sidebar-toggle-btn {
    border-left: none;
    border-right: 3px solid transparent;
    justify-content: center;
    padding-left: 0;
}

#right-sidebar-nav.expanded .sidebar-toggle-btn {
    justify-content: flex-start;
    padding-left: 10px;
}

#right-sidebar-nav .sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

#right-sidebar-nav .sidebar-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Layout Toggle Buttons inside Top Bar */
.actions button.layout-toggle-btn {
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--md-sys-shape-corner-extra-small);
    transition: opacity 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
    width: 28px;
    height: 28px;
    min-width: 28px;
    box-sizing: border-box;
}

.actions button.layout-toggle-btn:hover {
    opacity: 1;
    background-color: var(--md-sys-color-surface-hover);
    color: var(--md-sys-color-on-surface-strong);
    border-color: transparent;
    box-shadow: none;
}

.actions button.layout-toggle-btn.active {
    opacity: 1;
    color: var(--md-sys-color-primary);
}

.actions button.layout-toggle-btn svg {
    width: 16px !important;
    height: 16px !important;
}

.actions button.layout-toggle-btn svg * {
    width: auto !important;
    height: auto !important;
    fill: none !important;
}

/* Segment Control Button Styling for Combined Views */
.panel-segment-control {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.segment-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.segment-btn:hover {
    color: var(--md-sys-color-on-surface);
    background: rgba(255, 255, 255, 0.03);
}

.segment-btn.active {
    color: var(--md-sys-color-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Layout Toggle Buttons inside Sidebar Headers */
.sidebar-toggle-btn.layout-toggle-btn {
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    box-sizing: border-box;
    width: 100%;
    padding: var(--md-sys-spacing-4) 0;
    margin-bottom: var(--md-sys-spacing-4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

#sidebar.expanded .sidebar-toggle-btn.layout-toggle-btn {
    justify-content: flex-start;
    padding-left: 13px; /* Align with other icons */
}

#right-sidebar-nav.expanded .sidebar-toggle-btn.layout-toggle-btn {
    justify-content: flex-start;
    padding-left: 13px; /* Align with other icons */
}

.sidebar-toggle-btn.layout-toggle-btn:hover {
    opacity: 1;
    background-color: var(--md-sys-color-surface-hover);
    color: var(--md-sys-color-on-surface-strong);
}

.sidebar-toggle-btn.layout-toggle-btn.active {
    opacity: 1;
    color: var(--md-sys-color-primary);
}

.sidebar-toggle-btn.layout-toggle-btn svg {
    width: 16px !important;
    height: 16px !important;
}

.sidebar-toggle-btn.layout-toggle-btn svg * {
    width: auto !important;
    height: auto !important;
    fill: none !important;
}

/* Timer Active Pulsing Indicator */
@keyframes timer-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(80, 250, 123, 0.4);
        border-color: #50fa7b;
    }
    70% {
        box-shadow: 0 0 0 6px rgba(80, 250, 123, 0);
        border-color: #50fa7b;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(80, 250, 123, 0);
        border-color: #50fa7b;
    }
}

.timer-active {
    animation: timer-pulse 2s infinite;
    color: #50fa7b !important;
}

#right-sidebar-nav .sidebar-item[data-tab="timer"].timer-active .sidebar-icon {
    color: #50fa7b !important;
    filter: drop-shadow(0 0 3px #50fa7b);
}

.timer-paused {
    color: #ffb86c !important;
}

#right-sidebar-nav .sidebar-item[data-tab="timer"].timer-paused .sidebar-icon {
    color: #ffb86c !important;
}
