/* ============================================================
   LEFT SIDEBAR NAVIGATION - 5MIND STYLE
   ============================================================ */

.left-sidebar {
    position: fixed;
    left: 0;
    top: 0; /* Join with filter bar */
    width: 280px;
    height: 100vh;
    background: #ffffff;
    padding: 0;
    padding-top: 70px; /* Exact header height, no gap */
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid #e5e7eb;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

/* Gray background strip at top (behind header/button area) */
.left-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #f9fafb;
    z-index: -1;
}

/* ============================================================
   SIGN-UP PROMPT (FOR NON-LOGGED-IN USERS)
   ============================================================ */
.sidebar-signup-prompt {
    background: linear-gradient(135deg, #2a9b8f 0%, #3aab9f 50%, #4abfb3 100%);
    border-radius: 10px;
    padding: 16px 16px;
    margin: 12px 12px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 12px rgba(17, 185, 162, 0.3);
    animation: fadeIn 0.4s ease;
}

.signup-prompt-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
}

.signup-prompt-text {
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 14px 0;
    color: rgba(255, 255, 255, 0.95);
}

.signup-prompt-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.sidebar-signup-prompt .signup-btn,
.sidebar-signup-prompt .login-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

.sidebar-signup-prompt .signup-btn {
    background: white;
    color: #0d3d4a;
}

.sidebar-signup-prompt .signup-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.sidebar-signup-prompt .login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.sidebar-signup-prompt .login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   USER PROFILE SECTION
   ============================================================ */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 16px 24px; /* More left padding */
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-profile:hover {
    background: #f3f4f6;
}

.sidebar-profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.sidebar-profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-profile-display-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-profile-username {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Verification badge in profile */
.sidebar-profile-display-name .verification-badge {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-nav {
    background: transparent;
    padding: 16px 12px 16px 20px; /* More left padding */
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1; /* Take remaining space, pushing footer down */
}

/* Submit Button Dropdown Container */
.sidebar-submit-dropdown {
    position: relative;
    margin: 0 2px 8px 2px;
}

/* Submit Button Group - Split Design */
.sidebar-submit-btn-group {
    display: flex;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Main Submit Link (80%) */
.sidebar-submit-main {
    flex: 0 0 80%;
    padding: 12px 18px;
    background: #1bcdb6;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-submit-main:hover {
    background: #15b8a4;
}

/* Toggle Button (20%) */
.sidebar-submit-toggle {
    flex: 0 0 20%;
    padding: 12px 8px;
    background: #1bcdb6;
    color: white;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-submit-toggle:hover {
    background: #15b8a4;
}

/* Submit Carat Icon */
.submit-carat {
    transition: transform 0.2s ease;
}

.sidebar-submit-toggle.active .submit-carat {
    transform: rotate(180deg);
}

/* Submit Dropdown Menu */
.sidebar-submit-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.sidebar-submit-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Submit Option Links */
.sidebar-submit-option {
    display: block;
    padding: 12px 16px;
    color: #1f2937;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar-submit-option:last-child {
    border-bottom: none;
}

.sidebar-submit-option:hover {
    background: #f9fafb;
    color: #2563eb;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px 10px 18px; /* More left padding */
    color: #4b5563;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 10px;
    margin: 0 2px;
}

.sidebar-link:hover:not(.disabled) {
    background: #f3f4f6;
    color: #111827;
    transform: translateX(2px);
}

.sidebar-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #9ca3af;
}

.sidebar-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    color: #6b7280;
    transition: color 0.2s ease;
}

.sidebar-link:hover:not(.disabled) .sidebar-icon {
    color: #2563eb;
}

.sidebar-link.active .sidebar-icon {
    color: #2563eb;
}

.sidebar-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.coming-soon-badge {
    font-size: 10px;
    background: #fbbf24;
    color: #78350f;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--divider-color);
    margin: 16px 0;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding: 8px 16px 4px 16px;
    margin-top: 8px;
}

.sidebar-suggest-feature {
    text-align: center;
    padding: 24px 16px 20px 16px;
    margin-top: auto;
}

.sidebar-suggest-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-suggest-link:hover {
    color: #2563eb;
}

.sidebar-suggest-link img {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sidebar-suggest-link:hover img {
    opacity: 1;
}

/* Active link styling */
.sidebar-link.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #2563eb;
    border-radius: 0 3px 3px 0;
}

/* Adjust main content to account for sidebar */
@media (min-width: 1025px) {
    body {
        margin-left: 280px;
    }
    
    /* Filters inherit width from main-content container */
    .main-content {
        margin-left: 0;
    }
}

/* Hide sidebar on tablets and mobile */
@media (max-width: 1024px) {
    .left-sidebar {
        transform: translateX(-100%);
    }
    
    .left-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    }
}

/* Mobile toggle button (optional - can be added to header) */
.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.2s ease;
}

.sidebar-mobile-toggle:hover {
    transform: scale(1.1);
}

.sidebar-mobile-toggle:active {
    transform: scale(0.95);
}

@media (max-width: 1024px) {
    .sidebar-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Overlay for mobile when sidebar is open */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Scrollbar styling - minimal and elegant */
.left-sidebar::-webkit-scrollbar {
    width: 8px;
}

.left-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.left-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
    border: 2px solid #ffffff;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Count badge styling */
.count-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    margin-left: 6px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

.count-badge:empty,
.count-badge[data-count="0"] {
    display: none;
}

/* ============================================================
   SIDEBAR FOOTER - Legal & Copyright
   ============================================================ */
.sidebar-footer {
    padding: 10px 16px 12px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto; /* Push to bottom */
}

/* Privacy Policy - Terms of Service (inline) */
.sidebar-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sidebar-footer-link {
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sidebar-footer-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.footer-separator {
    color: #9ca3af;
    font-size: 13px;
    user-select: none;
}

/* Contact & Support */
.sidebar-footer-contact {
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
    text-align: center;
    display: block;
}

.sidebar-footer-contact:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Copyright */
.sidebar-copyright {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 400;
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

/* ============================================================
   LOGIN-REQUIRED INDICATORS
   ============================================================ */
.login-required {
    position: relative;
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: auto !important;
}

.login-required::after {
    content: '🔒';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.7;
}

.sidebar-submit-dropdown.login-required::after {
    right: 24px;
    top: 12px;
    transform: none;
}

.login-required:hover {
    opacity: 0.6;
}

/* ============================================================
   BACK TO TOP (IN SIDEBAR WHITESPACE)
   ============================================================ */
.sidebar-back-to-top {
    position: fixed;
    top: 20px;
    left: 140px; /* Center of 280px sidebar */
    transform: translateX(-50%);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 100; /* Same as sidebar, behind header */
    transition: opacity 0.2s ease;
}

.sidebar-back-to-top:hover {
    opacity: 0.7;
}

.sidebar-back-to-top-icon {
    width: 20px;
    height: 20px;
    animation: bounce 2s infinite;
}

.sidebar-back-to-top-text {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.sidebar-back-to-top:hover .sidebar-back-to-top-icon {
    animation: bounceUp 0.6s ease;
}

@keyframes bounceUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* Hide on mobile */
@media (max-width: 1024px) {
    .sidebar-back-to-top {
        display: none;
    }
}
