/* Global Scrollbar Styling */
* {
  scrollbar-width: 8px;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(0, 0, 0, 0.15);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --eli-drawer-background: rgba(30, 30, 30, 0.95);
    --eli-white: #ffffff;
    --eli-drawer-grey: rgba(255, 255, 255, 0.6);
    --eli-card-background: rgba(255, 255, 255, 0.08);
    --eli-card-active: rgba(255, 255, 255, 0.15);
    --eli-border-radius: 16px;
    --eli-spacing-sm: 8px;
    --eli-spacing-md: 12px;
    --eli-spacing-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Avenir', sans-serif;
    background: transparent;
    color: var(--eli-white);
    overflow-x: hidden;
    overflow-y: auto;
}

.menu-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    min-height: 100vh;
    background: var(--eli-drawer-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px var(--eli-spacing-sm);
    display: flex;
    flex-direction: column;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--eli-spacing-md);
    margin-bottom: 12px;
}

.menu-title {
    font-size: 34px;
    font-weight: 900;
    color: var(--eli-white);
    letter-spacing: -0.5px;
}

.close-button {
    background: transparent;
    border: none;
    color: var(--eli-white);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    opacity: 0.8;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.close-button:active {
    background: rgba(255, 255, 255, 0.15);
}

.menu-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.workspace-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 20px;
}

.recent-projects-section {
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.section-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--eli-white);
    letter-spacing: -0.3px;
    padding: 0 var(--eli-spacing-md);
    margin-bottom: 8px;
}

/* Workspace Item */
.workspace-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    background: var(--eli-card-background);
    border-radius: var(--eli-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
}

.workspace-item:hover {
    background: var(--eli-card-active);
}

.workspace-item.active {
    background: var(--eli-card-active);
}

.workspace-placeholder {
    opacity: 0.65;
}

/* Workspace Avatar */
.workspace-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.workspace-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.workspace-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
}

.workspace-avatar-active-ring {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--eli-white);
    border-radius: 50%;
    pointer-events: none;
}

/* Workspace Info */
.workspace-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.workspace-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--eli-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
}

.workspace-subtitle {
    font-size: 20px;
    font-weight: 500;
    color: var(--eli-drawer-grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-expired {
    font-size: 20px;
    font-weight: 500;
    color: #ff4444;
    margin-top: 2px;
}

/* Workspace Menu */
.workspace-menu {
    position: relative;
    flex-shrink: 0;
    padding-top: 11px;
    z-index: 2;
}

.menu-button {
    background: none;
    border: none;
    color: var(--eli-white);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

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

.menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% - 4px);
    background: rgba(40, 40, 40, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--eli-white);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-item:last-child {
    border-bottom: none;
}

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

.menu-item.delete-item {
    color: #ff4444;
}

.menu-item svg {
    flex-shrink: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--eli-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .menu-container {
        max-width: 100%;
        width: 100%;
    }

    .menu-title {
        font-size: 28px;
    }

    .workspace-title {
        font-size: 18px;
    }

    .workspace-subtitle {
        font-size: 16px;
    }

    .workspace-expired {
        font-size: 16px;
    }

    .workspace-avatar {
        width: 50px;
        height: 50px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.menu-container {
    animation: slideIn 0.3s ease-out;
}
