/********************************************************************************
 * Copyright (C) 2017, 2018 TypeFox and others.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the Eclipse
 * Public License v. 2.0 are satisfied: GNU General Public License, version 2
 * with the GNU Classpath Exception which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
 ********************************************************************************/

@import url("~@lumino/widgets/style/index.css");
@import url("~font-awesome/css/font-awesome.min.css");

/*-----------------------------------------------------------------------------
| General
|----------------------------------------------------------------------------*/

:root {
    /* Product OS Design System Variables */
    --product-os-primary: #4285F4;
    --product-os-primary-hover: #5294FF;
    --product-os-bg-dark: #1E1E1E;
    --product-os-bg-darker: #161616;
    --product-os-text-primary: #FFFFFF;
    --product-os-text-secondary: #B8B8B8;
    --product-os-text-muted: #808080;
    --product-os-border: rgba(255, 255, 255, 0.1);
    --product-os-spacing-xs: 4px;
    --product-os-spacing-sm: 8px;
    --product-os-spacing-md: 12px;
    --product-os-spacing-lg: 16px;
    --product-os-spacing-xl: 24px;
    --product-os-radius-sm: 4px;
    --product-os-radius-md: 8px;
    --product-os-font-body: 14px;
    --product-os-font-small: 12px;
    --product-os-font-heading: 16px;
    --product-os-transition: all 0.2s ease;
    
    /* Borders: Width and color (dark to bright) */

    --theia-border-width: 1px;
    --theia-panel-border-width: 1px;

    /* UI fonts: Family, size and color (bright to dark)
     ---------------------------------------------------
     The UI font CSS variables are used for the typography all of the Theia
     user interface elements that are not directly user-generated content.
   */

    --theia-ui-font-scale-factor: 1.2;
  --theia-ui-font-size0: calc(
    var(--theia-ui-font-size1) / var(--theia-ui-font-scale-factor)
  );
  --theia-ui-font-size1: 13px; /* Base font size */
  --theia-ui-font-size2: calc(
    var(--theia-ui-font-size1) * var(--theia-ui-font-scale-factor)
  );
  --theia-ui-font-size3: calc(
    var(--theia-ui-font-size2) * var(--theia-ui-font-scale-factor)
  );
  --theia-ui-icon-font-size: 14px; /* Ensures px perfect FontAwesome icons */
    --theia-ui-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Content fonts: Family, size and color (bright to dark)
     Content font variables are used for typography of user-generated content.
   */

    --theia-content-font-size: 13px;
    --theia-content-line-height: 22px;

    --theia-code-font-size: 13px;
    --theia-code-line-height: 17px;
    --theia-code-padding: 5px;
    --theia-code-font-family: Menlo, Monaco, Consolas, "Droid Sans Mono",
        "Courier New", monospace, "Droid Sans Fallback";
    --theia-monospace-font-family: monospace;
    --theia-ui-padding: 6px;

    /* Icons */
    --theia-icon-size: 16px;

    /* Scrollbars */
    --theia-scrollbar-width: 10px;
    --theia-scrollbar-rail-width: 10px;

    /* Statusbar */
    --theia-statusBar-font-size: 12px;

    /* Opacity for disabled mod  */
    --theia-mod-disabled-opacity: 0.4;
}

html,
body {
    height: 100vh;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: var(--theia-ui-font-family);
    background: var(--theia-editor-background);
    color: var(--theia-foreground);
    border: 1px solid var(--theia-window-activeBorder);
}

body:window-inactive,
body:-moz-window-inactive {
    border-color: var(--theia-window-inactiveBorder);
}

a {
    color: var(--theia-textLink-foreground);
}

a:active,
a:hover {
    color: var(--theia-textLink-activeForeground);
}

code {
    color: var(--theia-textPreformat-foreground);
}

blockquote {
    margin: 0 7px 0 5px;
    padding: 0px 16px 0px 10px;
    background: var(--theia-textBlockQuote-background);
    border-left: 5px solid var(--theia-textBlockQuote-border);
}

.theia-input {
    background: var(--theia-input-background);
    color: var(--theia-input-foreground);
    border: var(--theia-border-width) solid var(--theia-input-border);
    font-family: var(--theia-ui-font-family);
    font-size: var(--theia-ui-font-size1);
    line-height: var(--theia-content-line-height);
    padding: 3px 0 3px 8px;
    border-radius: 2px;
    min-height: 28px;
    box-sizing: border-box;
}

.theia-input[type="text"] {
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theia-input[type="checkbox"],
.theia-input[type="radio"] {
    min-height: unset;
}

.theia-input::placeholder {
    color: var(--theia-input-placeholderForeground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theia-maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.theia-ApplicationShell {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--theia-editor-background);
}

.theia-preload {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50000;
    background: var(--theia-editor-background);
    background-size: 60px 60px;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    transition: opacity 0.8s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.theia-preload::after {
    animation: 1s theia-preload-rotate infinite;
  color: #777; /* color works on both light and dark themes */
  content: "\eb19"; /* codicon-load */
    font: normal normal normal 72px/1 codicon;
}

@keyframes theia-preload-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.theia-preload.theia-hidden {
    opacity: 0;
}

.theia-icon {
    width: 32px;
    height: 18px;
    margin: 5px;
    margin-left: 8px;
}

.theia-mod-disabled,
.theia-mod-disabled:focus {
    opacity: var(--theia-mod-disabled-opacity) !important;
}

.theia-header {
    text-transform: uppercase;
    font-size: var(--theia-ui-font-size0);
    font-weight: 700;
}

.lm-Widget {
    font-size: var(--theia-ui-font-size1);
    /** We override the contain of lm-Widget to make sure Monaco autocomplete etc. is correctly applied */
    contain: none !important;
}

.lm-Widget.lm-mod-hidden {
    display: none !important;
}

.noselect,
.no-select {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome and Opera */
    -o-user-select: none;
}

/* Since an iframe has its own focus tracking, we don't show focus on iframes */
:focus:not(iframe) {
    outline-width: 1px;
    outline-style: solid;
    outline-offset: -1px;
    opacity: 1;
    outline-color: var(--theia-focusBorder);
}

::selection {
    background: var(--theia-selection-background);
}

.action-label {
    padding: 2px;
    border-radius: 4px;
    cursor: pointer;
}

.action-label:hover {
    background-color: var(--theia-toolbar-hoverBackground);
}

.theia-button {
    border: none;
    color: var(--theia-button-foreground);
    min-width: 65px;
    outline: none;
    cursor: pointer;
    padding: 6px 9px;
    margin-left: calc(var(--theia-ui-padding) * 2);
    border-radius: 2px;
}

.theia-button:focus {
    outline: 1px solid var(--theia-focusBorder);
    outline-offset: 1px;
}

.theia-button.secondary {
    color: var(--theia-secondaryButton-foreground);
}

.theia-button[disabled] {
    opacity: 0.6;
    color: var(--theia-button-disabledForeground);
    background-color: var(--theia-button-disabledBackground);
    cursor: default;
}

button.secondary[disabled],
.theia-button.secondary[disabled] {
    color: var(--theia-secondaryButton-disabledForeground);
    background-color: var(--theia-secondaryButton-disabledBackground);
}

.theia-select {
    color: var(--dropdown-foreground);
    font-size: var(--theia-ui-font-size1);
    border-radius: 2px;
    border: 1px solid var(--theia-dropdown-border);
    background: var(--theia-dropdown-background);
    outline: none;
    cursor: pointer;
}

.theia-select option {
    background: var(--theia-dropdown-listBackground);
}

.theia-transparent-overlay {
    background-color: transparent;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 999;
}

.theia-cursor-no-drop,
.theia-cursor-no-drop:active {
    cursor: no-drop;
}

/*-----------------------------------------------------------------------------
| Import children style files
|----------------------------------------------------------------------------*/

@import "./os.css";
@import "./dockpanel.css";
@import "./dialog.css";
@import "./menus.css";
@import "./sidepanel.css";
@import "./tabs.css";
@import "./scrollbars.css";
@import "./tree.css";
@import "./status-bar.css";
@import "./tree-decorators.css";
@import "./about.css";
@import "./search-box.css";
@import "./ansi.css";
@import "./view-container.css";
@import "./notification.css";
@import "./alert-messages.css";
@import "./icons.css";
@import "./widget.css";
@import "./quick-title-bar.css";
@import "./progress-bar.css";
@import "./breadcrumbs.css";
@import "./tooltip.css";
@import "./split-widget.css";
@import "./symbol-icon.css";

/*-----------------------------------------------------------------------------
| Product OS - Custom Navigation Bar
|----------------------------------------------------------------------------*/

#theia-top-panel.product-os-navbar {
    background: var(--product-os-bg-dark);
    border-bottom: 1px solid var(--product-os-border);
    min-height: 48px;
    max-height: 48px;
}

.product-os-nav-content {
    width: 100%;
    height: 48px;
}

.product-os-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--product-os-spacing-lg);
}

.product-os-nav-brand {
    font-size: var(--product-os-font-heading);
    font-weight: 600;
    color: var(--product-os-text-primary);
    letter-spacing: 0.5px;
}

.product-os-nav-links {
    display: flex;
    gap: var(--product-os-spacing-xl);
    flex: 1;
    justify-content: center;
}

.product-os-nav-link {
    color: var(--product-os-text-secondary);
    text-decoration: none;
    font-size: var(--product-os-font-body);
    padding: var(--product-os-spacing-sm) var(--product-os-spacing-md);
    border-radius: var(--product-os-radius-sm);
    transition: var(--product-os-transition);
}

.product-os-nav-link:hover {
    color: var(--product-os-text-primary);
    background: var(--product-os-border);
}

.product-os-nav-actions {
    display: flex;
    gap: var(--product-os-spacing-md);
}

.product-os-nav-button {
    background: var(--product-os-primary);
    color: var(--product-os-text-primary);
    border: none;
    padding: var(--product-os-spacing-sm) var(--product-os-spacing-lg);
    border-radius: var(--product-os-radius-sm);
    font-size: var(--product-os-font-body);
    font-weight: 500;
    cursor: pointer;
    transition: var(--product-os-transition);
}

.product-os-nav-button:hover {
    background: var(--product-os-primary-hover);
    transform: translateY(-1px);
}

.product-os-nav-button:active {
    transform: translateY(0);
}

/* Active nav link state */
.product-os-nav-link.active {
    color: var(--product-os-text-primary);
    background: rgba(66, 133, 244, 0.2);
    border-bottom: 2px solid var(--product-os-primary);
}

/* Top panel stacking: menu bar on top, Product OS nav below */
#theia-top-panel {
    display: flex !important;
    flex-direction: column !important;
}

#theia-top-panel > .lm-Widget {
    width: 100%;
    flex-shrink: 0;
}

#theia-top-panel .lm-MenuBar {
    display: none !important; /* Hide menu bar for now */
}

#theia-top-panel #product-os-nav-bar {
    order: 1;
    display: block !important;
}

/* Hide blocking icon element */
#theia\:icon {
    display: none !important;
}


/* Product OS: Always show AI Chat - hide close button */
#chat-view .lm-TabBar-tabCloseIcon,
.lm-TabBar-tab[data-id="chat-view"] .lm-TabBar-tabCloseIcon {
    display: none !important;
}
