/* ========================================
   VSCode v1.106 - Main Styles (Enhanced)
   ======================================== */

/* CSS Variables - VSCode Dark Theme (Exact) */
:root {
    /* Core Colors */
    --vscode-bg: #1e1e1e;
    --vscode-sidebar-bg: #252526;
    --vscode-activity-bg: #333333;
    --vscode-editor-bg: #1e1e1e;
    --vscode-titlebar-bg: #323233;
    --vscode-statusbar-bg: #007acc;
    --vscode-statusbar-remote: #16825d;
    --vscode-statusbar-debug: #cc6633;
    --vscode-panel-bg: #1e1e1e;
    --vscode-input-bg: #3c3c3c;
    --vscode-dropdown-bg: #3c3c3c;
    --vscode-button-bg: #0e639c;
    --vscode-button-hover: #1177bb;
    
    /* Text Colors */
    --vscode-text: #cccccc;
    --vscode-text-secondary: #858585;
    --vscode-text-disabled: #5a5a5a;
    --vscode-text-highlight: #ffffff;
    --vscode-text-link: #3794ff;
    --vscode-text-preformat: #d7ba7d;
    
    /* Border Colors */
    --vscode-border: #454545;
    --vscode-border-light: #3c3c3c;
    --vscode-border-active: #007acc;
    --vscode-focus-border: #007acc;
    
    /* Accent Colors */
    --vscode-accent: #007acc;
    --vscode-accent-hover: #1a8cdb;
    --vscode-error: #f14c4c;
    --vscode-error-bg: rgba(241, 76, 76, 0.1);
    --vscode-warning: #cca700;
    --vscode-warning-bg: rgba(204, 167, 0, 0.1);
    --vscode-info: #3794ff;
    --vscode-info-bg: rgba(55, 148, 255, 0.1);
    --vscode-success: #89d185;
    --vscode-success-bg: rgba(137, 209, 133, 0.1);
    
    /* Selection */
    --vscode-selection: #264f78;
    --vscode-selection-inactive: #3a3d41;
    --vscode-highlight: rgba(255, 255, 0, 0.15);
    --vscode-word-highlight: rgba(87, 87, 87, 0.72);
    --vscode-line-highlight: rgba(255, 255, 255, 0.04);
    
    /* Diff Colors */
    --vscode-diff-added: rgba(40, 167, 69, 0.2);
    --vscode-diff-removed: rgba(220, 53, 69, 0.2);
    --vscode-diff-modified: rgba(255, 193, 7, 0.1);
    
    /* Scrollbar */
    --vscode-scrollbar: rgba(121, 121, 121, 0.4);
    --vscode-scrollbar-hover: rgba(100, 100, 100, 0.7);
    --vscode-scrollbar-active: rgba(191, 191, 191, 0.4);
    
    /* Fonts */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif;
    --font-mono: 'Fira Code', Consolas, 'Courier New', monospace;
    --font-size: 13px;
    --font-size-small: 11px;
    --line-height: 1.4;
    --editor-font-size: 14px;
    --editor-line-height: 20px;
    
    /* Sizes */
    --titlebar-height: 30px;
    --activity-bar-width: 48px;
    --sidebar-width: 260px;
    --statusbar-height: 22px;
    --tab-height: 35px;
    --breadcrumb-height: 22px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--vscode-bg);
    color: var(--vscode-text);
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: var(--line-height);
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbars - VSCode Exact */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--vscode-scrollbar);
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--vscode-scrollbar-hover);
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: var(--vscode-bg);
}

/* Utility Classes */
.hidden { display: none !important; }
.invisible { visibility: hidden !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.spin { animation: spin 1s linear infinite; }

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

/* Focus Ring */
:focus {
    outline: none;
}

:focus-visible {
    outline: 1px solid var(--vscode-focus-border);
    outline-offset: -1px;
}

/* ========================================
   Splash Screen (Enhanced)
   ======================================== */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1e1e1e 0%, #252526 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#splash-screen.fade-out {
    animation: splashFadeOut 0.6s ease forwards;
}

@keyframes splashFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

.splash-content {
    text-align: center;
    width: 400px;
}

.vscode-logo-animated {
    margin-bottom: 32px;
}

.vscode-svg {
    filter: drop-shadow(0 4px 20px rgba(0, 122, 204, 0.3));
}

.logo-part {
    opacity: 0;
    animation: logoPartFade 0.5s ease forwards;
}

.logo-part-1 { animation-delay: 0.2s; }
.logo-part-2 { animation-delay: 0.4s; }
.logo-part-3 { animation-delay: 0.6s; }

@keyframes logoPartFade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.splash-title {
    font-size: 32px;
    font-weight: 400;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    opacity: 0;
    animation: fadeInUp 0.5s ease 0.8s forwards;
}

.splash-content .version {
    font-size: 12px;
    color: var(--vscode-text-secondary);
    margin-bottom: 48px;
    opacity: 0;
    animation: fadeInUp 0.5s ease 0.9s forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.splash-loader-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeIn 0.5s ease 1s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.splash-loader {
    flex: 1;
    height: 2px;
    background: var(--vscode-input-bg);
    border-radius: 1px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 0%;
    background: var(--vscode-accent);
    border-radius: 1px;
    transition: width 0.1s linear;
}

.loader-percentage {
    font-size: 12px;
    color: var(--vscode-text-secondary);
    min-width: 35px;
    text-align: right;
}

.loading-text {
    font-size: 13px;
    color: var(--vscode-text);
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeIn 0.5s ease 1.1s forwards;
}

.loading-details {
    opacity: 0;
    animation: fadeIn 0.5s ease 1.2s forwards;
}

.loading-item {
    font-size: 11px;
    color: var(--vscode-text-secondary);
    transition: color 0.2s;
}

.loading-item.active {
    color: var(--vscode-text);
}

/* ========================================
   Main Container
   ======================================== */
#vscode-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    opacity: 0;
    animation: containerFadeIn 0.4s ease forwards;
}

@keyframes containerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   Title Bar (Enhanced)
   ======================================== */
.title-bar {
    display: flex;
    align-items: center;
    height: var(--titlebar-height);
    background: var(--vscode-titlebar-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    -webkit-app-region: drag;
}

.title-bar-left {
    display: flex;
    align-items: center;
    -webkit-app-region: no-drag;
}

.app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: var(--titlebar-height);
    margin-left: 4px;
}

.app-icon svg {
    width: 16px;
    height: 16px;
}

.menu-items {
    display: flex;
}

.menu-item {
    padding: 3px 8px;
    font-size: 13px;
    cursor: pointer;
    color: var(--vscode-text);
    border-radius: 3px;
    transition: background 0.1s;
}

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

.title-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    -webkit-app-region: drag;
}

.window-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--vscode-text-secondary);
}

.title-icon {
    color: var(--vscode-text-secondary);
}

.title-bar-right {
    display: flex;
    align-items: center;
    -webkit-app-region: no-drag;
}

.title-actions {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.title-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--vscode-text-secondary);
    cursor: pointer;
    border-radius: 3px;
}

.title-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--vscode-text);
}

.window-controls {
    display: flex;
    height: 100%;
}

.window-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: var(--titlebar-height);
    border: none;
    background: transparent;
    color: var(--vscode-text);
    cursor: pointer;
    transition: background 0.1s;
}

.window-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.window-btn.close:hover {
    background: #e81123;
    color: white;
}

/* ========================================
   Main Area
   ======================================== */
.main-area {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========================================
   Activity Bar (Enhanced)
   ======================================== */
.activity-bar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: var(--activity-bar-width);
    background: var(--vscode-activity-bg);
}

.activity-icons-top,
.activity-icons-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.activity-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--activity-bar-width);
    height: var(--activity-bar-width);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.15s;
}

.activity-icon::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: var(--vscode-text);
    transition: height 0.15s ease;
}

.activity-icon:hover {
    color: rgba(255, 255, 255, 0.8);
}

.activity-icon.active {
    color: white;
}

.activity-icon.active::before {
    height: 24px;
}

.activity-icon i {
    font-size: 24px;
}

.activity-icon .badge {
    position: absolute;
    top: 7px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: white;
    background: var(--vscode-accent);
    border-radius: 9px;
}

/* ========================================
   Sidebar (Enhanced)
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--vscode-sidebar-bg);
    border-right: 1px solid var(--vscode-border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 35px;
    padding: 0 20px 0 10px;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vscode-text-secondary);
}

.sidebar-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.sidebar-header:hover .sidebar-actions {
    opacity: 1;
}

.sidebar-actions i {
    padding: 4px;
    font-size: 16px;
    color: var(--vscode-text-secondary);
    cursor: pointer;
    border-radius: 3px;
}

.sidebar-actions i:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--vscode-text);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--vscode-text-secondary);
    background: var(--vscode-sidebar-bg);
    position: sticky;
    top: 0;
    z-index: 1;
}

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

.section-header i {
    font-size: 16px;
    transition: transform 0.15s;
}

.section-header.open i.codicon-chevron-right,
.section-header.open i.codicon-chevron-down {
    transform: rotate(0deg);
}

.section-header:not(.open) i.codicon-chevron-right,
.section-header:not(.open) i.codicon-chevron-down {
    transform: rotate(-90deg);
}

/* Search Box */
.search-box {
    padding: 8px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--vscode-input-bg);
    border: 1px solid transparent;
    border-radius: 2px;
    margin-bottom: 4px;
}

.search-input-wrapper:focus-within {
    border-color: var(--vscode-focus-border);
}

.search-input {
    flex: 1;
    padding: 4px 8px;
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--vscode-text);
    background: transparent;
    border: none;
    outline: none;
}

.search-input::placeholder {
    color: var(--vscode-text-secondary);
}

.search-input-actions {
    display: flex;
    padding-right: 4px;
}

.search-input-actions i {
    padding: 2px 4px;
    font-size: 14px;
    cursor: pointer;
    color: var(--vscode-text-secondary);
    border-radius: 3px;
    opacity: 0.7;
}

.search-input-actions i:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.search-input-actions i.active {
    opacity: 1;
    color: var(--vscode-accent);
}

.search-info {
    padding: 4px 8px;
    font-size: 12px;
    color: var(--vscode-text-secondary);
}

/* ========================================
   Status Bar (Enhanced)
   ======================================== */
.status-bar {
    display: flex;
    justify-content: space-between;
    height: var(--statusbar-height);
    background: var(--vscode-statusbar-bg);
    font-size: 12px;
}

.status-left,
.status-right {
    display: flex;
    align-items: center;
    height: 100%;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    height: 100%;
    color: white;
    white-space: nowrap;
}

.status-item.clickable {
    cursor: pointer;
    transition: background 0.1s;
}

.status-item.clickable:hover {
    background: rgba(255, 255, 255, 0.12);
}

.status-item.remote {
    background: var(--vscode-statusbar-remote);
}

.status-item.error {
    background: transparent;
}

.status-item.error i {
    color: var(--vscode-error);
}

.status-item.warning i {
    color: var(--vscode-warning);
}

.status-item i {
    font-size: 14px;
}

.notification-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--vscode-accent);
    border-radius: 50%;
    display: none;
}

.status-item:has(.notification-dot.active) .notification-dot {
    display: block;
}

/* ========================================
   Command Palette (Enhanced)
   ======================================== */
.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.command-palette-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.command-palette-modal {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
    background: var(--vscode-dropdown-bg);
    border: 1px solid var(--vscode-border);
    box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.36);
    animation: paletteSlideIn 0.1s ease;
}

@keyframes paletteSlideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.command-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--vscode-border);
}

.command-input-wrapper i {
    color: var(--vscode-text-secondary);
    font-size: 16px;
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--vscode-text);
    font-size: 14px;
    font-family: var(--font-family);
}

.command-list {
    max-height: 400px;
    overflow-y: auto;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    cursor: pointer;
}

.command-item:hover,
.command-item.selected {
    background: var(--vscode-selection);
}

.command-item i {
    color: var(--vscode-text-secondary);
    width: 16px;
    text-align: center;
}

.command-item .command-label {
    flex: 1;
    color: var(--vscode-text);
}

.command-item .command-keybinding {
    font-size: 11px;
    color: var(--vscode-text-secondary);
}

.command-item .command-keybinding kbd {
    padding: 1px 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--vscode-border);
    border-radius: 3px;
    margin-left: 2px;
}

.command-footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 6px;
    background: var(--vscode-sidebar-bg);
    border-top: 1px solid var(--vscode-border);
    font-size: 11px;
    color: var(--vscode-text-secondary);
}

.command-footer kbd {
    padding: 1px 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--vscode-border);
    border-radius: 3px;
    margin: 0 2px;
}

/* ========================================
   Notifications (Enhanced)
   ======================================== */
.notifications {
    position: fixed;
    bottom: 30px;
    right: 15px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 450px;
}

.notification {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--vscode-dropdown-bg);
    border: 1px solid var(--vscode-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: notificationSlideIn 0.25s ease;
}

.notification.fade-out {
    animation: notificationSlideOut 0.2s ease forwards;
}

@keyframes notificationSlideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes notificationSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50px); }
}

.notification-icon {
    font-size: 18px;
    margin-top: 2px;
}

.notification.info .notification-icon { color: var(--vscode-info); }
.notification.success .notification-icon { color: var(--vscode-success); }
.notification.warning .notification-icon { color: var(--vscode-warning); }
.notification.error .notification-icon { color: var(--vscode-error); }

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

.notification-source {
    font-size: 11px;
    color: var(--vscode-text-secondary);
    margin-bottom: 2px;
}

.notification-message {
    font-size: 13px;
    color: var(--vscode-text);
    word-wrap: break-word;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.notification-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: var(--vscode-button-bg);
    color: white;
    border: none;
    cursor: pointer;
}

.notification-btn:hover {
    background: var(--vscode-button-hover);
}

.notification-btn.secondary {
    background: transparent;
    color: var(--vscode-text);
    border: 1px solid var(--vscode-border);
}

.notification-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-close {
    cursor: pointer;
    color: var(--vscode-text-secondary);
    padding: 2px;
}

.notification-close:hover {
    color: var(--vscode-text);
}

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay {
    position: fixed;
    top: var(--titlebar-height);
    left: 0;
    width: 100%;
    z-index: 8000;
    padding: 12px 20px;
    background: var(--vscode-sidebar-bg);
    border-bottom: 1px solid var(--vscode-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.loading-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: var(--vscode-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-bar {
    flex: 1;
    height: 2px;
    background: var(--vscode-input-bg);
    border-radius: 1px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: var(--vscode-accent);
    transition: width 0.1s linear;
}

.loading-overlay .loading-text {
    font-size: 12px;
    color: var(--vscode-text-secondary);
    white-space: nowrap;
}

/* ========================================
   Notification Center
   ======================================== */
.notification-center {
    position: fixed;
    bottom: 30px;
    right: 15px;
    width: 380px;
    max-height: 500px;
    background: var(--vscode-dropdown-bg);
    border: 1px solid var(--vscode-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 9001;
    animation: notificationCenterIn 0.2s ease;
}

@keyframes notificationCenterIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--vscode-border);
    font-size: 12px;
    font-weight: 600;
}

.notification-clear {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    background: transparent;
    border: none;
    color: var(--vscode-text-link);
    cursor: pointer;
}

.notification-clear:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}
