/* Centralized Sidebar Component Styles - Consistent Logo */

/* CSS Variables - Consistent with index.css */
:root {
    --deep-black: #000000;
    --pure-white: #FFFFFF;
    --purple-deep: #7C3AED;
    --purple-light: #A855F7;
    --purple-gradient: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Body adjustments for sidebar */
body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
}

/* Hamburger Menu Button */
.menu-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: rgba(40, 40, 40, 0.9);
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.menu-toggle:hover {
    background: rgba(60, 60, 60, 0.9);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    margin: 2px;
    background: #ffffff;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hide hamburger when sidebar is active */
.menu-toggle.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50px);
}

/* Alternative: Hide when sidebar overlay is active */
.sidebar-overlay.active ~ .menu-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #1f1f1f;
    border-right: 1px solid #333;
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: var(--font-primary);
}

.sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Sidebar Header - STANDARDIZED LOGO */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid #333;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--purple-gradient);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.logo-text {
    background: var(--purple-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

/* Fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
    .logo-text {
        color: var(--purple-light);
    }
}

.close-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.close-btn svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    width: 22px;
    height: 22px;
}

/* Sidebar Content */
.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 0;
}

.nav-section {
    padding: 0 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem;
    margin: 0.25rem 0;
    color: #888;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 500;
    font-family: var(--font-primary);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(168, 85, 247, 0.15);
    color: #fff;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

.create-btn {
    background: #2d2d2d !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 1.15rem;
    margin-top: 0.5rem;
}

.create-btn:hover {
    background: #3d3d3d !important;
    transform: translateY(-1px);
}

.sidebar-divider {
    height: 1px;
    background: #333;
    margin: 0.5rem 1rem;
}

/* Twin List Section */
.twin-list-section {
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.twin-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.5rem;
    color: #888;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.twin-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.twin-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    color: #888;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    font-size: 0.95rem;
}

.twin-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.twin-item.active {
    background: rgba(168, 85, 247, 0.15);
    color: #fff;
}

.twin-item-icon {
    width: 32px;
    height: 32px;
    background: var(--purple-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.twin-item-content {
    flex: 1;
    min-width: 0;
}

.twin-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.twin-item-status {
    font-size: 0.75rem;
    color: #888;
    opacity: 0.8;
    margin-top: 2px;
}

/* Add these styles for the twin menu dropdown */

.twin-item-menu {
    position: relative;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.twin-item:hover .twin-item-menu {
    opacity: 1;
}

.twin-menu-button {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.twin-menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.twin-menu-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.twin-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.twin-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.twin-menu-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.twin-menu-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.twin-menu-option.delete {
    color: #ff6b6b;
}

.twin-menu-option.delete:hover {
    background: rgba(255, 107, 107, 0.1);
}

.twin-menu-option svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

.twin-list-empty {
    padding: 1rem 0.5rem;
    text-align: center;
    color: #888;
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Create Section */
.create-section {
    padding: 0 1rem;
    margin-bottom: 1rem;
}

/* Spacer */
.sidebar-spacer {
    flex: 1;
}

/* Upgrade Section */

.upgrade-section {
    padding: 1rem;
}

.upgrade-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    color: var(--pure-white);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Remove special styling from upgrade highlight */
.upgrade-highlight {
   
    font-weight: inherit; /* Use the same weight as parent */
    background: none; /* Remove any background */
    padding: 0; /* Remove padding */
}

/* Add purple hover effect on entire button */
.upgrade-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
    color: var(--purple-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.2);
}

/* Optional: Add a subtle icon or effect */
.upgrade-btn::before {
    content: "✨";
    margin-right: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.upgrade-btn:hover::before {
    opacity: 1;
}


/* User Section */
.user-section {
    transition: all 0.2s ease;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.05);
}
.user-avatar {
    width: 36px; /* Increased from 32px */
    height: 36px; /* Increased from 32px */
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem; /* Increased from 0.875rem */
    flex-shrink: 0;
}

.username {
    color: #fff;
    font-size: 1rem; /* Increased from 0.9rem */
    font-weight: 600; /* Increased font weight */
    flex: 1;
}

.dropdown-icon {
    color: #888;
    flex-shrink: 0;
}

.dropdown-icon svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    width: 16px;
    height: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        left: -260px;
    }
    
    .menu-toggle {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.4rem;
    }
    
    .hamburger-line {
        width: 16px;
    }

    .sidebar .nav-logo .logo-text {
        font-size: 1.4rem;
    }
    
    .nav-item {
        font-size: 1.05rem;
        padding: 0.9rem 1rem;
    }
    
    .create-btn {
        font-size: 1.1rem;
    }
    
    .upgrade-btn {
        font-size: 0.95rem;
        padding: 0.9rem 1rem;
    }
    
    .username {
        font-size: 0.95rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sidebar {
        background: rgba(0, 0, 0, 0.95);
        border-right: 2px solid rgba(255, 255, 255, 0.3);
    }

    .nav-item {
        border: 1px solid transparent;
    }

    .nav-item:hover,
    .nav-item.active {
        border-color: currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .nav-item,
    .menu-toggle,
    .hamburger-line,
    .sidebar-overlay,
    .sidebar,
    .twin-item {
        transition: none;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .menu-toggle,
    .sidebar-overlay {
        display: none;
    }
}

/* Add these at the end of the file to override any conflicts */

/* Force consistent user styling across all pages */
body .sidebar .user-section .user-info .user-avatar {
    width: 36px !important;
    height: 36px !important;
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}

body .sidebar .user-section .user-info .username {
    color: #ffffff !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    font-family: var(--font-primary) !important;
}

/* Ensure hover effects work consistently */
body .sidebar .user-section .user-info:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}