@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('animations.css');
@import url('features.css');
@import url('layout-fixes.css');
@import url('settings.css');

:root {
    /* Vercel / Next.js Style Monochromatic Palette */
    --bg-primary: #000000;
    --bg-secondary: #0A0A0A;
    --bg-tertiary: #111111;
    --bg-hover: #1A1A1A;
    --bg-card: #0A0A0A;
    
    --text-primary: #EDEDED;
    --text-secondary: #A0A0A0;
    --text-muted: #666666;
    
    --accent-color: #FFFFFF;
    --accent-hover: #EBEBEB;
    
    --border-color: #222222;
    --border-hover: #333333;
    
    --sidebar-width: 260px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Tailwind-style rounded, oval radiuses */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 0 24px 16px; /* Right padding 0 so scrollbar is at the edge */
    height: 100%;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 32px 0; /* Add right padding here instead */
}

.logo-container {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    gap: 12px;
    letter-spacing: -0.5px;
}

.custom-logo {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.collapse-btn:hover {
    color: var(--text-primary);
}

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

/* Sidebar specific scrollbar */
.sidebar-content::-webkit-scrollbar {
    width: 4px; /* Thin scrollbar */
}
.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-content::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}
.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 32px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    font-size: 16px;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-primary);
}

/* Sidebar Sections (Projects, History) */
.sidebar-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.section-header:hover {
    color: var(--text-primary);
}

.section-content {
    display: flex;
    flex-direction: column;
    padding-top: 4px;
}

.section-item {
    padding: 8px 32px 8px 30px; /* Extra right padding for the dots */
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
    position: relative;
}

.section-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.item-options-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-hover);
    border: none;
    color: var(--text-primary);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.item-options-btn:hover {
    background: #333;
}

.section-item:hover .item-options-btn {
    opacity: 1;
}

/* History Context Menu */
.history-context-menu {
    position: fixed;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: var(--radius-md);
    padding: 8px;
    display: none;
    flex-direction: column;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.history-context-menu.active {
    display: flex;
}

.context-menu-item {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-align: left;
    transition: background-color 0.2s;
}

.context-menu-item:hover {
    background-color: var(--bg-hover);
}

.context-menu-item i {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Editing input inside section-item */
.section-item-input {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 13px;
    font-family: inherit;
    width: calc(100% - 24px);
    outline: none;
}
.section-item-input:focus {
    border-color: var(--accent-color);
}

.history-group {
    margin-bottom: 16px;
}

.history-label {
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* User Profile Section */
.user-profile-wrapper {
    margin-top: auto;
    position: relative;
    padding-top: 16px;
    padding-right: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile:hover, .user-profile.active {
    background-color: var(--bg-hover);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Popover Menu */
.popover-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 0;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 50;
}

.popover-menu.show {
    display: block;
}

.popover-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.popover-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.popover-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.popover-item .nav-icon {
    font-size: 16px;
}

.popover-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 6px 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.d-none { display: none !important; }
