/* ROOT COLORS USED FOR THE IDE */
:root {
    --goland-bg: #2b2d30;
    --goland-darker: #1e1f22;
    --goland-sidebar: #2b2d30;
    --goland-text: #bcbec4;
    --goland-line-numbers: #4b5059;
    --goland-selection: #2d5a88;
    --goland-cursor: #bcbec4;
}

/**
 *******************************************************************************************************************
 * DRAWER BUTTON MODES - The different width splits the editor can be in depending on the mode
 *******************************************************************************************************************
 */

.mode-minimal .editor-content,
.mode-minimal #fileTabs,
.mode-minimal #codeEditor,
.mode-minimal #lineNumbers,
.mode-minimal #codeArea {
    display: none !important;
}

.mode-minimal .project-sidebar {
    width: 280px;
    border-right: 1px solid #1e1f22;

    transition: width 0.3s ease-in-out, min-width 0.3s ease-in-out, max-width 0.3s ease-in-out;
}

/* Status bar should be hidden in minimal mode */
.mode-minimal .status-bar {
    display: none !important;
}

.mode-split {
    width: calc(100% - 500px); /* Width of screen minus code generator width */
}

.mode-split.code-gen-active {
    width: calc(100% - 500px) !important; /* Same as split mode without code generator */
}

.mode-full {
    width: 100%;
}

.mode-full.code-gen-active {
    width: calc(100% - 500px) !important;
}

.mode-closed {
    width: 0;
}

/* Show code generator button in split and full modes */
.mode-split #codeGenButton,
.mode-full #codeGenButton {
    display: flex !important;
}

/* /static/css/modes.css */
.mode-minimal .editor-content {
    display: none;
}

.mode-minimal .drawer-trigger,
.mode-split .drawer-trigger,
.mode-full .drawer-trigger {
    display: none;
}

.mode-closed .drawer-trigger {
    display: flex;
}

.mode-split .editor-content,
.mode-full .editor-content {
    display: flex;
}

#codeEditor.visible {
    display: flex !important;
    width: 100%;
}

/**
 *******************************************************************************************************************
 * DRAWER BUTTON TRIGGER - Top Left of the page that will open the IDE
 *******************************************************************************************************************
 */

.drawer-trigger {
    position: fixed;
    top: 90px !important;
    left: 8px;
    z-index: 20 !important;
    padding: 4px;
    background: #3c3f41;
    border-radius: 4px;
    color: #bcbec4;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 24px;
}

.drawer-trigger:hover {
    background: #4b4d50;
    color: white;
}

/**
 *******************************************************************************************************************
 * DRAWER BUTTON CONTROLS - Top Right of the IDE to choose minimal, split, or full screen
 *******************************************************************************************************************
 */

.drawer-controls {
    position: absolute;
    top: -2px;
    right: 0;
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    z-index: 30;
}

.drawer-button {
    border-radius: 0.375rem;
    transition: all 0.2s;
    color: #bcbec4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-button:hover {
    background: #4b4d50;
    color: white;
    cursor: pointer;
}

.drawer-button.active {
    background: #4b4d50;
    color: white;
}

.drawer-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

.drawer-controls > * {
    margin-left: 2px;
}

.drawer-controls > *:first-child {
    margin-left: 0;
}

.editor-drawer {
    position: fixed;
    left: 0;
    height: calc(100vh - 85px) !important;
    background: var(--goland-darker);
    z-index: 20 !important;
    overflow: hidden;
    transition: width 0.3s ease;
}

.editor-drawer > .flex {
    max-width: 100%;
    height: 100%;
}

.mode-minimal {
    /*width: 330px !important;*/
    overflow: hidden;
}

.editor-content {
    flex: 1;
    width: calc(100% - 330px);
    height: 100% !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.line-numbers-content {
    flex-grow: 1;
    min-height: 100%;
}

/**
 *******************************************************************************************************************
 * OPEN AI ASSISTANT - Top right under the drawer controls that triggers the opening of the AI Assistant
 *******************************************************************************************************************
 */

.code-generator {
    position: absolute;
    top: 0;
    right: 0;
    display: none;
    gap: 0.25rem;
    padding-top: 1px;
    padding-right: 1px;
    z-index: 20;
}

.code-generator-button {
    padding: 0.10rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    color: #bcbec4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-generator-button:hover {
    background: #4b4d50;
    color: white;
}

.code-generator-button.active {
    background: #4b4d50;
    color: white;
}

.code-generator-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/**
 *******************************************************************************************************************
 * AI BUTTON CONTROLS - Top right of the AI Assistant View that changes the AI Assistant to different modes/panels
 *******************************************************************************************************************
 */

.ai-button {
    border-radius: 0.375rem;
    transition: all 0.2s;
    color: #bcbec4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-button:hover {
    background: #4b4d50;
    color: white;
    cursor: pointer;
}

.ai-button.active {
    background: #4b4d50;
    color: white;
}

.ai-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ai-button > * {
    margin-left: 2px;
}

.ai-controls > *:first-child {
    margin-left: 0;
}

/**
 *******************************************************************************************************************
 * ALL AI ASSISTANT WINDOW CSS - All of the different sections of the AI Assistant
 *******************************************************************************************************************
 */

.code-generator-sidebar {
    width: 500px;
    min-width: 500px;
    max-width: 500px;
}

#codeGenerator {
    width: 500px;
    position: fixed;
    right: 0;
    top: 85px !important;
    height: calc(100vh - 85px) !important;
    background: #2b2d30;
    border-left: 1px solid #1e1f22;
    display: none;
    z-index: 20;
}

.generate-request {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-top: -13px;
}

#codeGenButton.active {
    background: #4b4d50;
    color: white;
}

.code-generator-visible {
    display: flex !important;
}

#codeGenInput {
    width: 95% !important;
    height: 40px !important;
    line-height: 40px !important;
    white-space: nowrap !important;
    padding: 0 27px 0 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: transparent !important;
}

#generateCode.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #bcbec4;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

#generateCode.loading svg {
    width: 16px;
    height: 16px;
}

#generateCode:not(.loading) .spinner {
    display: none;
}

#generateCode.loading .arrow {
    display: none;
}

#responseContainer {
    height: 100%;
    max-height: calc(100% - 22px);
    overflow-y: auto;
    box-sizing: border-box;
    margin: 8px;
    border-radius: 8px;
}

.responseButtonContainer {
    background: var(--goland-bg);
    height: 24px;
    padding: 3px;
    gap: 3px;
    right: 16px;
    transform: translateY(-17px);
    bottom: 108px;
}

.button-gradient {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);
}

#retryButton:hover {
    background: #4b4d50;
    color: white;
}

#resetButton:hover {
    background: #4b4d50;
    color: white;
}

#streamingResponse {
    max-height: 100%;
    overflow-y: auto;
    display: none;
}

/* Ensure response scrollbar is visible */
#streamingResponse::-webkit-scrollbar {
    width: 12px;
}

#streamingResponse::-webkit-scrollbar-track {
    background: #1e1f22;
}

#streamingResponse::-webkit-scrollbar-thumb {
    background: #3c3f41;
    border-radius: 6px;
    border: 3px solid #1e1f22;
}

.input-container {
    padding-bottom: 16px;
}

#cancelButton {
    position: absolute;
    right: 18px;
    bottom: 25px;
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    display: none;
}

.enter-icon {
    position: absolute;
    right: 27px;
    bottom: 28px;
    background: none;
    border: none;
    align-items: center;
    justify-content: center;
    color: #bcbec4;
}

.loading-animation {
    display: flex;
    align-items: center;
    width: 100px;
    height: 50px;
    margin-top: 20px;
}

.loading-animation-repository {
    display: none;
    width: 100px;
    height: 50px;
    margin: 20px auto;
}

#responseArea {
    margin-bottom: 17px !important;
    padding-bottom: 10px !important;
}

/* Scrollbar styling */
#responseContainer::-webkit-scrollbar {
    width: 8px;
}

#responseContainer::-webkit-scrollbar-track {
    background: #21262d;
}

#responseContainer::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

#responseContainer::-webkit-scrollbar-thumb:hover {
    background: #3f4851;
}


/**
 *******************************************************************************************************************
 * AI ASSISTANT RESPONSE README STYLE FORMATTING
 *******************************************************************************************************************
 */

.readme-content {
    line-height: 1.6;
    padding: 0.5rem;
    max-width: 100%;
    color: #e6edf3;
    overflow-y: auto;
    max-height: 100%;
    background: rgba(240, 240, 240, 0.1);
}

.readme-content pre {
    background-color: #161b22;
    margin: 1rem 0;
    overflow-x: auto;
    /*white-space: pre;*/
    width: 100%;
    box-sizing: border-box;
}

.readme-content pre code {
    font-size: 14px;
    line-height: 1.5;
    tab-size: 2;
    color: #e6edf3;
    display: inline-block;
    min-width: 100%;
    white-space: pre;
}

/* Pre tag scrollbar */
.readme-content pre::-webkit-scrollbar {
    height: 8px;
}

.readme-content pre::-webkit-scrollbar-track {
    background: #21262d;
    border-radius: 4px;
}

.readme-content pre::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.readme-content pre::-webkit-scrollbar-thumb:hover {
    background: #3f4851;
}

code:not(pre code) {
    background: #161b22;
    border-radius: 4px;
    /*padding: 2px 6px;*/
    font-size: 0.9em;
    color: #e6edf3;
    border: 1px solid #30363d;
}

.readme-content code:not(pre code) {
    background: #161b22;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
    color: #e6edf3;
    border: 1px solid #30363d;
}

.readme-content .inline-code {
    background: #161b22;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
    color: #e6edf3;
    border: 1px solid #30363d;
    white-space: nowrap;
}

.readme-content h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #e6edf3;
}

.readme-content .ordered-list {
    list-style-type: decimal;
    padding-left: 2em;
    margin-bottom: 1rem;
}

.readme-content .unordered-list {
    list-style-type: disc;
    padding-left: 2em;
    margin-bottom: 1rem;
}

.readme-content ol {
    list-style-type: decimal;
    padding-left: 2em;
}

.readme-content ul {
    list-style-type: disc;
    padding-left: 2em;
    margin-bottom: 1rem;
}

.readme-content ol > li {
    display: list-item !important;
    transform: none !important;
}

/**
 *******************************************************************************************************************
 * CODE BLOCK FORMATTING FOR THE AI ASSISTANT RESPONSE
 *******************************************************************************************************************
 */

.code-block-wrapper {
    margin: 1rem 0;
    border: 1px solid #2b2d30;
    overflow: hidden;
}

.code-block-title {
    padding-left: 9px;
    background-color: #3c3f41;
    border-bottom: 1px solid #2b2d30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    box-sizing: border-box;
}

.language-label {
    font-weight: 500;
    color: var(--goland-text);
}

/* Adjust the code block spacing to account for title bar */
.code-block-wrapper pre {
    margin: 0 !important;
    padding: 0 1rem 1rem;
}

/* Make sure the error indicators are positioned relative to the code block */
.code-block-wrapper .relative {
    position: relative;
}

.title-actions {
    display: flex;
    right: 0;
    align-items: center;
    height: 100%;
    padding-right: 2px;
}

.title-button {
    background: transparent;
    border: none;
    color: var(--goland-text);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    height: 24px;
    transition: background-color 0.2s;
    gap: 2px;
}

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

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

/**
 *******************************************************************************************************************
 * ALL FILE DISPLAYING ACCORDION VIEW
 *******************************************************************************************************************
 */
.hs-accordion-treeview-root {
    flex: 1;
    overflow: auto; /* Allow both scrollbars */
    min-height: 0;
    min-width: 0; /* Allow content to determine scroll width */
    padding-bottom: 4px; /* Space for horizontal scrollbar */
}

/* Accordion items need min-width to prevent shrinking */
.hs-accordion {
    min-width: min-content;
    width: 100%;
}

/* Accordion content needs to maintain width */
.hs-accordion-content {
    min-width: min-content;
    width: max-content;
}

/* Ensure folder content maintains width */
.folder-content {
    min-width: min-content;
    width: max-content;
}

/* Keep text from wrapping */
.folder-name, .file-name {
    white-space: nowrap;
}

/* Base arrow styling */
.hs-accordion-toggle svg {
    transform-origin: center;
    transition: transform 0.2s ease-in-out;
    transform: rotate(0deg);
}

.hs-accordion-toggle.active svg {
    transform: rotate(90deg);
}

/* Active state for arrow rotation */
.hs-accordion.active > .hs-accordion-heading .hs-accordion-toggle svg {
    transform: rotate(90deg);
}

/* Color styling */
.hs-accordion-toggle svg {
    color: #9da0a4;
}

.hs-accordion-toggle:hover svg {
    color: #bcbec4;
}

/**
 *******************************************************************************************************************
 * ALL MODAL POPUPS
 *******************************************************************************************************************
 */

#createModal,
#renameModal,
#repoModal,
#contextMenu {
    z-index: 40 !important;
}

/* User dropdown - above header but below modals */
#userDropdown {
    z-index: 50 !important;
}

/* Ensure modals have proper backdrop */
#createModal,
#renameModal,
#repoModal {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Modal content should be above the backdrop */
#createModal > div,
#renameModal > div,
#repoModal > div {
    position: relative;
    z-index: 40 !important;
}

/* Context menu should always be on top */
#contextMenu {
    position: fixed;
    z-index: 40 !important;
}

/**
 *******************************************************************************************************************
 * ALL THE FILE TABS CSS
 *******************************************************************************************************************
 */

.file-tabs-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #1e1c1cbd;
}

.file-tab-div {
    max-width: calc(100% - 5px);
    overflow-x: auto;
    transform: rotateX(180deg);
}

.file-tab-div > * {
    transform: rotateX(180deg); /* flips the content back to normal */
}

.file-tab {
    display: -webkit-box;;
    padding: 0.1rem 0.4rem;
    gap: 0.25rem;
    color: #bcbec4;
    border-radius: 0.25rem 0.25rem 0 0;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    margin-right: 1px;
    height: 32px;
    flex-shrink: 0;
    white-space: nowrap;
    align-items: center;
    transition: opacity 0.2s, transform 0.2s, background-color 0.2s;
}

/* Hover highlight */
.file-tab:hover {
    background-color: rgba(209, 213, 219, 0.21);
    cursor: default !important;
}

/* Active tab shouldn't change on hover */
.file-tab.active:hover {
    background-color: inherit; /* Or whatever your active tab background is */
}

.file-tab.drag-over {
    border-left: 2px solid #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

/* Optional: Add a subtle shadow effect when dragging */
.file-tab[draggable="true"]:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-tab[draggable="true"] {
    cursor: default !important; /* Force default cursor even when draggable */
}

.file-tab.active {
    border-bottom: 3px solid #06c;
}

.file-tab:hover .close-button {
    opacity: 1;
}

.close-button {
    width: 13px;
    height: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

.close-button:hover {
    background: #3c3f41;
}

/**
 *******************************************************************************************************************
 * ALL THE SIDEBAR FEATURES INCLUDING THE EDITOR TITLE AND FILE STATUS
 *******************************************************************************************************************
 */

.project-sidebar {
    width: 280px;
    min-width: 280px;
    position: relative;
    flex-shrink: 0;
    border-right: 1px solid #1e1f22;
    height: calc(100% - 58px);
}

/* Header stays fixed */
.project-sidebar > div:first-child {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--goland-bg);
    min-width: 280px;
}

.title-bar {
    position: relative;
    height: 32px;
    background: #3c3f41;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2b2d30;
    padding: 0 8px;
}

.title-text {
    color: #bcbec4;
    margin-left: 14px;
}

.file-status-button {
    position: absolute;
    right: 0;
    padding-right: 5px;
}

.fileStatusInformationHeader {
    background: #F8F9FE;
    padding: 8px 16px;
    border-bottom: 1px solid #E8EAED;
    border-radius: 8px 8px 0 0;
}

/**
 *******************************************************************************************************************
 * WELCOME SCREEN WHEN THERE IS NO CODE TO DISPLAY IN THE SPLIT/FULL SCREEN EDITOR VIEW
 *******************************************************************************************************************
 */

.welcome-title {
    font-size: 24px;
    font-weight: 600;
    color: #bcbec4;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    font-size: 14px;
    color: #8b8d91;
    letter-spacing: -0.2px;
}

/**
 *******************************************************************************************************************
 * ALL THE <pre> TAG SYNTAX HIGHLIGHTING FOR THE EDITOR
 *******************************************************************************************************************
 */
.editor-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 38px);
    margin: 0 !important;
    pointer-events: none;
    z-index: 1;
    padding: 1.3px 0 0 1.9px !important;
    white-space: pre;
    overflow-wrap: normal;
    display: block;
    tab-size: 4;
    transition: padding-bottom 0.2s;
    overflow: hidden !important;
}

.editor-highlight code {
    tab-size: 4;
    white-space: pre;
    padding: 0 0 60px 0 !important;
    color: #bcbec4;
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
}

.editor-highlight .suggestion,
.editor-highlight .suggestion .token,
.editor-highlight .suggestion .token.variable,
.editor-highlight .suggestion .token.punctuation,
.editor-highlight .suggestion .token.string,
.editor-highlight .suggestion * {
    color: #808080 !important;
    opacity: 0.8 !important;
    text-decoration: none !important;
    background: transparent !important;
    font-style: normal !important;
    text-shadow: none !important;
}

/* Ensure proper background color */
.editor-highlight,
.editor-highlight code {
    background: transparent !important;
}

/**
 *******************************************************************************************************************
 * THE LINE NUMBERS ON THE IDE EDITOR
 *******************************************************************************************************************
 */

.line-numbers {
    background: #1e1c1cbd;
    overflow-y: hidden;
    counter-reset: line;
    border-right: 1px solid #1e1f22;
    padding: 2px 16px 92px 20px;
    display: flex;
    flex-direction: column;
    position: static;
    transition: padding-bottom 0.2s;
}

.line-number {
    counter-increment: line;
    width: 1rem;
    text-align: right;
    color: var(--goland-line-numbers);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.line-number::before {
    content: counter(line);
}

.change-gutter {
    background: #1e1c1cbd;       /* match your line-numbers bg */
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    width: 6px;                  /* narrow - just the bar */
    flex-shrink: 0;
    padding: 2px 0 92px 0;       /* match vertical padding of .line-numbers */
    box-sizing: unset;
}

.change-gutter-line {
    height: 21px;              /* must match .line-number height exactly */
    width: 100%;
    flex-shrink: 0;
}

/* Added by user = green */
.change-gutter--added {
    background-color: #57965c;
}

/* Deleted by user = gray */
.change-gutter--deleted {
    background-color: #6e7681;
}

/* Modified (mixed or adjacent add+delete) = blue */
.change-gutter--modified {
    background-color: #4a9eda;
}


.change-gutter-popup {
    font-family: "JetBrains Mono", "DejaVu Sans Mono", Consolas, monospace;
    position: absolute;
    z-index: 9999;
    min-width: 300px;
    max-width: 600px;
    background: #2b2b2b;
    border: 1px solid #3c3f41;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    overflow: hidden;
}

.change-gutter-popup__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #313335;
    border-bottom: 1px solid #3c3f41;
}

.change-gutter-popup__label {
    flex: 1;
    color: #a9b7c6;
    font-size: 12px;
}

.change-gutter-popup__revert {
    padding: 2px 10px;
    background: transparent;
    border: 1px solid #6e7681;
    border-radius: 3px;
    color: #a9b7c6;
    font-size: 12px;
    cursor: pointer;
}

.change-gutter-popup__revert:hover {
    background: #4a9eda22;
    border-color: #4a9eda;
    color: #4a9eda;
}

.change-gutter-popup__close {
    background: transparent;
    border: none;
    color: #6e7681;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}

.change-gutter-popup__close:hover {
    color: #a9b7c6;
}

.change-gutter-popup__content {
    margin: 0;
    padding: 8px 10px;
    color: #a9b7c6;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    background: #1e1e1e;
    line-height: 1.5;
}

.change-gutter--added,
.change-gutter--deleted,
.change-gutter--modified {
    cursor: pointer;
}

/**
 *******************************************************************************************************************
 * THE HIGHLIGHTING LINE THAT INDICATES WHAT LINE YOU ARE ON IN THE IDE
 *******************************************************************************************************************
 */

.highlight-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: visible;
}

.highlight-line {
    position: absolute;
    left: -10rem;
    right: 0;
    height: 21.8px;
    background-color: rgba(240, 240, 240, 0.1);
    pointer-events: none;
}

/**
 *******************************************************************************************************************
 * ALL TEXTAREAS
 *******************************************************************************************************************
 */

textarea {
    font-size: 13px;
    padding: 4px 0 0 8px;
    caret-color: var(--goland-cursor);
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    line-height: 18px;
    display: block;
    height: calc(100% - 8px);
    transition: padding-bottom 0.2s;
    tab-size: 4;

    z-index: 1;  /* Make sure textarea is above overlay */
    background: transparent;  /* Make it transparent so we can see the overlay */
    color: transparent;  /* Make text transparent */
}

textarea::placeholder {
    font-size: inherit;  /* Match the input text size */
    line-height: inherit;  /* Match the input line height */
    padding: inherit;  /* Match the padding */
}

/* /static/css/scrollbars.css */
textarea::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

textarea::-webkit-scrollbar-track {
    background: var(--goland-darker);
}

textarea::-webkit-scrollbar-thumb {
    background: #3c3f41;
    border-radius: 6px;
    border: 3px solid var(--goland-darker);
}

textarea::-webkit-scrollbar-corner {
    background: var(--goland-darker);
}

textarea::selection {
    background-color: var(--goland-selection);
}

/**
 *******************************************************************************************************************
 * SPECIFICALLY THE TEXTAREA OF THE EDITOR
 *******************************************************************************************************************
 */

.highlight-textarea {
    padding-left: 2px;
    background: #1e1c1cbd;
    width: 100%;
    border: none !important;
    outline: none !important;
    resize: none !important;
    box-shadow: none !important;
    border-bottom: 1px solid transparent !important;
    padding-bottom: 35px !important;
    margin-bottom: 0 !important;
    height: calc(100% - 38px);
    color: transparent !important;
}

/* Remove the white line at bottom */
.highlight-textarea::-webkit-resizer {
    display: none;
}

.highlight-textarea:focus {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.textarea-wrapper {
    position: relative;
    border: 1px solid #404040;
    width: 100%;
    overflow: visible;
    background: #2b2d30;
}

/**
 *******************************************************************************************************************
 * ERRORS WITHIN THE EDITING TEXTAREA
 *******************************************************************************************************************
 */

.line-wrapper,
.yaml-error,
.token,
.highlight-container,
.editor-highlight {
    pointer-events: none;
}

/* Error styling */
.yaml-error {
    position: relative;
}

/* Wavy underline */
.yaml-error::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        #ff0000 0,
        #ff0000 4px,
        transparent 4px,
        transparent 8px
    );
}

/* Tooltip */
.error-tooltip {
    position: fixed;
    background: #444649;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--goland-text);
    white-space: nowrap;
    z-index: 40;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* Add a small offset */
    transform: translate(8px, 4px);
}

/**
 *******************************************************************************************************************
 * THE BOTTOM BAR OF THE EDITOR
 *******************************************************************************************************************
 */
.bottom-bar {
    position: absolute;
    width: 100%
}

/**
 *******************************************************************************************************************
 * RULES FOR FIND/REPLACE EITHER IN FILE OR IN ALL FILES
 *******************************************************************************************************************
 */

.highlight {
    background-color: rgba(255, 255, 0, 0.3);
    border-radius: 2px;
}
.active-highlight {
    background-color: rgba(255, 165, 0, 0.5);
    border-radius: 2px;
}

/* Base arrow styling */
.toggle-replace-button svg {
    transform-origin: center;
    transition: transform 0.2s ease-in-out;
    transform: rotate(0deg);
}

/* Active state for arrow rotation */
.toggle-replace-button.active svg {
    transform: rotate(90deg);
}

/**
 *******************************************************************************************************************
 * RULES FOR HIGHLIGHTING IN THE EDITOR
 *******************************************************************************************************************
 */

/* This is for the YAML highlighting */
/* Keys and section definitions - Light Orange */
.token.key,
.token.atrule {
    color: #e8915d !important;
    font-weight: 400 !important;
}

.token.code-generation {
    background: rgba(98, 245, 190, 0.21) !important;
    color: rgba(255, 242, 134, 0.97) !important;
    font-weight: 400 !important;
}

.token.code-gen-block {
    background: rgba(50, 205, 50, 0.2);
    color: #98c379;
    display: inline;
    padding: 2px 4px;
    border-radius: 2px;
    cursor: pointer;
}

.token.code-gen-block:hover {
    background: rgba(50, 205, 50, 0.3);
}

.code-tooltip {
    pointer-events: none;
}

/* Strings - Bright Green */
.token.string {
    color: #7ec699 !important;
    font-weight: 400 !important;
}

/* Template values - matching bright green */
.token.template-value {
    color: #7ec699 !important;
    font-weight: 400 !important;
}

/* Numbers and Booleans - Vibrant Blue */
.token.boolean,
.token.important,
.token.number {
    color: #79b8ff !important;
    font-weight: 400 !important;
}

.token.section,
.token.section .token.punctuation {
    color: #e8915d !important;
    font-weight: 400 !important;
}

/* Ensure all syntax stays same size */
.token {
    font-size: inherit !important;
}

.token.comment {
    color: #8b949e;
}
.token.property,
.token.key {
    color: #d2a8ff;
}

.token.string {
    color: #a5d6ff;
}

.ide-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: transparent;
    cursor: col-resize;
    z-index: 10;
}

.ide-resize-handle:hover {
    background: #007acc;
}

.ide-resize-handle.dragging {
    background: #007acc;
}

.merge-conflict-head {
    background-color: rgba(40, 167, 69, 0.1) !important;
    font-weight: bold !important;
    color: #28a745 !important;
    white-space: nowrap !important;
    padding-right: 3px !important;
}

.merge-conflict-head-content {
    background-color: rgba(40, 167, 69, 0.1) !important;
    color: #28a745 !important;
}

.merge-conflict-separator {
    color: inherit !important;
    font-weight: bold !important;
    background-color: transparent !important;
}

.merge-conflict-incoming {
    background-color: rgba(0, 128, 255, 0.2) !important;
    font-weight: bold !important;
    color: #4488ff !important;
}

.merge-conflict-incoming-content {
    background-color: rgba(0, 128, 255, 0.2) !important;
    color: #4488ff !important;
}

.merge-conflict-buttons {
    display: inline-flex !important;
    gap: 6px !important;
    margin-left: 16px !important;
    align-items: center !important;
}

.merge-btn {
    padding-left: 8px !important;
    color: #8b949e !important;
    font-size: 12px !important;
    cursor: pointer !important;
    line-height: 1.5 !important;
    min-height: auto !important;
    padding-right: 3px;
}

.merge-btn:hover {
    color: white !important;
}

/* Optional: Add some breathing room */
.merge-conflict-head .token {
    margin-right: 8px !important;
}

/* Make sure the conflict marker text doesn't wrap */
.merge-conflict-head .token.punctuation,
.merge-conflict-head .token.keyword {
    display: inline !important;
}

body.dragging-file .folder-item {
    transition: background-color 0.2s ease;
}

[draggable="true"] {
    cursor: move;
}

[draggable="true"]:active {
    cursor: grabbing;
}

.file-item.dragging {
    pointer-events: none;
}

/* Add this to your stylesheet or in a <style> tag */
.file-item[draggable="true"] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: move;
}

.file-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Prevent text selection on the entire file tree during drag */
body.dragging-file .file-tree-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.folder-item.drop-target {
    background-color: rgba(98, 76, 113, 0.55) !important;
    border: 2px dashed #a21caf !important;
    border-radius: 0.375rem;
}

/* Walkthrough Container - Position relative to editorContent */
.walkthrough-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1e1e1e;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.walkthrough-container.active {
    transform: translateX(0);
}

.walkthrough-slides {
    position: relative;
    flex: 1;
    overflow: hidden;
    width: 100%;
}

.walkthrough-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.walkthrough-slide.active {
    opacity: 1;
    visibility: visible;
}

.walkthrough-header {
    position: sticky;
    top: 0;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    padding: 1rem 2rem;
    z-index: 10;
    flex-shrink: 0;
}

.walkthrough-footer {
    position: sticky;
    bottom: 11px;
    background: #1e1e1e;
    border-top: 1px solid #333;
    padding: 0.6rem 2rem;
    z-index: 10;
    flex-shrink: 0;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4B5563;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background-color: #3B82F6;
    width: 24px;
    border-radius: 4px;
}

/* Markdown content styling */
.markdown-content {
    color: #e5e7eb;
}

.markdown-content h1 {
    font-size: 2rem !important;
    font-weight: bold !important;
    color: white;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.markdown-content h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: white;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-content h3 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #d1d5db;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-content h4 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #d1d5db;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-content h5 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #d1d5db;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.markdown-content h6 {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #d1d5db;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.markdown-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content code {
    background: #2b2d30;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #60a5fa;
}

.markdown-content pre {
    background: #2b2d30;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid #374151;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.markdown-content blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #9ca3af;
    font-style: italic;
}

.markdown-content a {
    color: #60a5fa;
    text-decoration: none;
}

.markdown-content a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.markdown-content strong {
    color: white;
    font-weight: 600;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid #374151;
    margin: 2rem 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.markdown-content th,
.markdown-content td {
    padding: 0.5rem;
    border: 1px solid #374151;
}

.markdown-content th {
    background: #2b2d30;
    font-weight: 600;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.markdown-content ol {
    list-style: decimal;
    padding-left: 1.5rem;
}
.markdown-content ul {
    list-style: disc;
    padding-left: 1.5rem;
}
.markdown-content li {
    display: list-item;
}

/* CSS Custom Property for dynamic panel height */
:root {
    --run-configuration-panel-height: 48px;
}

/* Sidebar container with relative positioning */
.hs-accordion-treeview-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* File tree container - padding prevents content from going under Run Configuration */
#fileTreeDiv {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--run-configuration-panel-height);
    padding-bottom: 10px;
    transition: padding-bottom 0.3s ease;
}

/* Bottom panel - absolute positioned at bottom */
.bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1e1e1e;
    z-index: 10;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Run Configuration panel content */
#runConfigurationPanelContent {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #1e1e1e;
    border-right: 2px solid #111827;
}

.bottom-panel.open #runConfigurationPanelContent {
    max-height: 40vh;
    height: 40vh;
    overflow-y: auto;
    overflow-x: auto;
}

/* Resource section trigger */
.resource-section-trigger {
    transition: background-color 0.15s ease;
}

.resource-section-trigger svg {
    transition: transform 0.2s ease;
}

.resource-section-trigger.open svg {
    transform: rotate(180deg);
}

/* Add to your existing styles */
.sidebar-action-btn.active {
    background-color: #2b2d30;
    color: white;
    position: relative;
}

.sidebar-action-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #a21caf; /* VS Code blue accent */
}

/* Button states and spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#commitButton:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed !important;
    color: #666666 !important;
    pointer-events: none !important;
}

#generate-commit-message:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed !important;
    color: #666666 !important;
    pointer-events: none !important;
}

.versions-header-tab {
    width: 50%;
    display: -webkit-box;;
    padding: 0.1rem 0.4rem;
    gap: 0.25rem;
    color: #bcbec4;
    font-size: 0.75rem;
    margin-right: 2px;
    height: 32px;
    flex-shrink: 0;
    white-space: nowrap;
    align-items: center;
    transition: opacity 0.2s, transform 0.2s, background-color 0.2s;
}

@keyframes pulse-glow { 0%,100%{opacity:1} 50%{opacity:.4} }
.dot-live { animation: pulse-glow 2.2s ease-in-out infinite; }

/* Pill open: fuse bottom edge into dropdown */
#version-pill-btn.pill-open {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-color: #111827 !important; /* gray-900 — hides the seam */
}
/* Dropdown open: remove top radius to meet pill flush */
#version-dropdown.pill-open {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

#pill-caret { transition: transform 0.2s ease; }
#pill-caret.rotated { transform: rotate(180deg); }

/* Resize handle */
.drawer-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.15s ease;
    display: none; /* hidden by default */
}

/* Only show the handle in split mode */
.editor-drawer.mode-split .drawer-resize-handle {
    display: block;
}

.drawer-resize-handle:hover,
.drawer-resize-handle.dragging {
    background: rgba(168, 85, 247, 0.4); /* purple accent on hover/drag */
}

/* While dragging, disable text selection and transitions globally */
body.drawer-resizing {
    user-select: none;
    cursor: col-resize;
}

body.drawer-resizing .editor-drawer {
    transition: none !important;
}

.bottom-panel.open #runConfigurationStatus {
    opacity: 1;
    pointer-events: auto;
}

.inline-code {
    background: #161b22;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
    color: #e6edf3;
    border: 1px solid #30363d;
    white-space: nowrap;
}

.textarea-wrapper,
.readme-content pre code,
#findAllFilesViewer,
#findAllFilesPreview {
    font-family: "JetBrains Mono", "DejaVu Sans Mono", Consolas, monospace;
}

#bullseye {
    height: 100%;
    width: 100%;
    display: block;
}
