/* Sidebar Styles */

/* Push body content when sidebar opens */
body {
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-open {
    margin-right: 400px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
}

.sidebar.open {
    right: 0;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.sidebar-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 4px;
}

.sidebar-tab {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-tab:hover {
    color: var(--text-primary);
}

.sidebar-tab.active {
    background: var(--primary);
    color: white;
}

.sidebar-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.sidebar-tab-content {
    display: none;
}

.sidebar-tab-content.active {
    display: block;
}

/* Empty State */
.sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.sidebar-empty-icon {
    margin-bottom: 16px;
    opacity: 0.3;
}

.sidebar-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.sidebar-empty p {
    font-size: 14px;
    margin: 0;
    max-width: 280px;
}

/* Sidebar List */
.sidebar-list {
    display: none;
    flex-direction: column;
    gap: 12px;
}

/* Sidebar Item */
.sidebar-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103, 126, 234, 0.15);
}

.sidebar-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-item-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.sidebar-item-remove {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-item-remove:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* Sidebar Prices */
.sidebar-item-prices {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-price {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    gap: 4px;
}

.sidebar-price.yes {
    background: rgba(34, 197, 94, 0.1);
}

.sidebar-price.no {
    background: rgba(239, 68, 68, 0.1);
}

.price-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-price.yes .price-label {
    color: #22c55e;
}

.sidebar-price.no .price-label {
    color: #ef4444;
}

.price-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-volume,
.sidebar-participants {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sidebar Positions (for Portfolio) */
.sidebar-item-positions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-position {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-position.yes {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.sidebar-position.no {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Sidebar Stats */
.sidebar-item-stats {
    display: flex;
    gap: 16px;
}

.stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.profit {
    color: #22c55e;
}

.stat-value.loss {
    color: #ef4444;
}

/* Sidebar Notification */
.sidebar-notification {
    position: fixed;
    top: 80px;
    right: 420px;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.sidebar-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Floating Sidebar Toggle Button */
.sidebar-toggle-float {
    position: fixed;
    top: 84px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: #e0115f;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(224, 17, 95, 0.5);
    z-index: 900;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(224, 17, 95, 0.7);
    background: #c00f52;
}

.sidebar-toggle-float:active {
    transform: translateY(0);
}

.sidebar-toggle-float svg {
    width: 24px;
    height: 24px;
}

/* Hide when sidebar is open */
.sidebar.open ~ .sidebar-toggle-float {
    opacity: 0;
    pointer-events: none;
}

/* Hamburger Menu Button (deprecated, keeping for compatibility) */
.sidebar-menu-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-menu-btn:hover {
    background: var(--bg-secondary);
}

.sidebar-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        right: -100%;
    }

    .sidebar-notification {
        right: 20px;
    }
}

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
