/* Define shades for dark/light mode as you like */
.theme-light{
    --matched-text:rgba(255, 255, 0, 0.2);
    --search-result:rgba(200,200,200,0.3);
    --hyperlink:rgb(22, 127, 255);
    --border:rgb(216, 216, 216);
    --tabs: rgb(240, 241, 243);
    --content-active: rgb(255, 255, 255);
    --content-inactive: rgb(255, 255, 255);
}
.theme-dark{    
    --matched-text:rgba(255, 255, 0, 0.2);
    --search-result:rgba(39, 39, 39, 0.5);
    --hyperlink:rgb(22, 127, 255);
    --border:rgb(56, 56, 56);
    --tabs: rgb(10, 10, 10);
    --content-active: rgb(24, 24, 24);
    --content-inactive: rgb(24, 24, 24);
}

/* Define font families as you like */
.theme-light,.theme-dark{
    --preview-font:'Roboto','Ubuntu','-apple-system','Source Han Sans','思源黑体','Microsoft Yahei';
    --edit-font: 'Roboto', 'Ubuntu','-apple-system','Source Han Sans','思源黑体','Microsoft Yahei';
}

/* Hide things */

/* Uncomment this to hide status bar 
.status-bar{
    display:none; 
}*/

/* Uncomment this to hide scrollbars 
::-webkit-scrollbar{
    display:none; 
}*/


/* ------------Section 1: Markdown Styles -------------*/

/* ------ Editor mode ------ */

.markdown-source-view {
    font-family: var(--edit-font);
}

/* make lines equal in height 
so it look like editing plain text */

.HyperMD-header.HyperMD-header-1.CodeMirror-line,
.HyperMD-header.HyperMD-header-2.CodeMirror-line,
.HyperMD-header.HyperMD-header-3.CodeMirror-line,
.HyperMD-header.HyperMD-header-4.CodeMirror-line,
.HyperMD-header.HyperMD-header-5.CodeMirror-line,
.HyperMD-header.HyperMD-header-6.CodeMirror-line,
.HyperMD-list-line.HyperMD-list-line-1.CodeMirror-line,
.HyperMD-list-line.HyperMD-list-line-2.CodeMirror-line,
.HyperMD-list-line.HyperMD-list-line-3.CodeMirror-line,
.HyperMD-list-line.HyperMD-list-line-4.CodeMirror-line,
.HyperMD-list-line.HyperMD-list-line-5.CodeMirror-line,
.HyperMD-list-line.HyperMD-list-line-6.CodeMirror-line,
.HyperMD-codeblock,
.HyperMD-footnote,
.HyperMD-list-line,
.CodeMirror-line,
.cm-header-1,
.cm-header-2,
.cm-header-3,
.cm-header-4,
.cm-header-5,
.cm-header-6,
.cm-math{
    line-height: 1.5rem !important;
    font-size: 1.0rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.cm-inline-code{
    font-size: 0.9rem !important;
}

/* make latex math codes upright*/
.cm-math{font-style: normal !important;}

/* remove the too-much indent for footnote */
.HyperMD-footnote{padding-left: 4px !important;}


/* ------ Preview mode ------ */

.markdown-preview-view{
    font-family: var(--preview-font);
}


/* headers */

h1{
    font-size: 1.5rem !important;
    font-weight: bold !important;
    text-align: center;
}
h2{
    font-size: 1.4rem !important;
    font-weight: bold !important;
}
h3{
    font-size: 1.15rem !important;
    font-weight: bold !important;
    font-style: italic !important;
    text-decoration: none;
}
h4{
    font-size: 1.15rem !important;
    font-weight: normal !important;
    font-style: italic !important;
    text-decoration: none !important; 
}
h5{
    font-size: 1.0rem !important;
    font-weight: normal !important;
    font-style: italic !important;
    text-decoration: underline !important; 
}
h6{
    font-size: 1.0rem !important;
    font-weight: normal !important;
    font-style: normal !important;
    text-decoration: underline !important; 
}

/* lists */
p,ul,ol{
    margin: 15px 0px !important;
}

/* make image smaller and center-aligned by default */

img{
    max-width:80% !important;
    margin:0px auto;
    text-align: center;
    display: table-cell;
}

/* hyperlinks style */

a:link{
    text-decoration: none !important;
    color: var(--hyperlink) !important;
}
a.link:hover,a.internal-link:hover{
    text-decoration: underline !important;
}

/* footnote */
.footnotes-sep{
    width: 300px;
    height: 1px !important;
    margin-bottom: 10px !important;
}
.footnotes-list{
    padding-left: 20px !important;
    font-size: 0.9rem;
}
.footnote-ref{
    font-size: inherit;
    vertical-align: baseline;
}

/*blockquote*/
blockquote{
    padding: 0px 15px !important;
    margin: 10px 20px;
}


/* ------------- Section 2: UI tweaking --------------*/

/* add 1px border on the top edge because otherwise it looks wired in Windows*/
.app-container{
    border-top: solid var(--border) !important;
    border-width:1px !important; 
}

/* Flow of cards */
.workspace-split.mod-vertical{
    overflow-x:auto; 
}
/* Set the minimum width of the cards when overflowing
(One known problem is that one cannot drag the cards wider) */
.workspace-split > .workspace-leaf,
.workspace-split > .workspace-split{
    min-width: 500px; /* Change this value as you wish */
}

/*Content Card*/
.view-header{
    border: 0px !important; /*remove border under file title*/
    height: 34px;
}
.view-header,
.view-header-title-container::after,
.view-content{
    background: transparent !important; /*make UI elements transparent*/
}
/*Set card bg */
.workspace-leaf{background: var(--content-inactive);}
.workspace-leaf.mod-active{ background: var(--content-active);}

.markdown-preview-view{
    padding: 25px;
}
.markdown-source-view{
    padding: 25px;
}
.CodeMirror.cm-s-obsidian.CodeMirror-wrap,
.CodeMirror-code{
    padding: 0px;
}
.CodeMirror-scroll{
    padding-right: 30px;
}
.CodeMirror-sizer{
    border-right-width: 0px !important;
    padding: 0px !important;
}

/* Embed content */
.markdown-embed{
    padding: 0px !important;
    margin: 20px 0px !important;
    border-radius: 4px !important;
    background: transparent !important;
}
.markdown-embed-content{
    padding: 15px !important;
}
.markdown-embed-title{
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    height: auto;
    font-size: 1.1rem;
}
.file-embed{
    padding: 3px !important;
    margin: 3px !important;
    border-radius: 4px !important;
}
.file-embed-title{
    font-size: 0.8rem;
    line-height: 24px;
    font-weight: normal;
}

/* Popover */
.popover.hover-popover{
    background-color: var(--content-active);
    border: solid var(--border) !important;
    border-width: 1px !important;
    border-radius: 0px !important;
}
.popover.hover-popover.is-loaded>.markdown-embed{
    margin: 0px !important;
}
.popover.hover-popover.mod-empty>.markdown-embed{
    margin: 0px 20px !important;
}

/* Search */
.document-search-container{
    /*add border to search control*/
    border-top: solid var(--border) !important;
    border-right: solid var(--border) !important;
    border-width: 1px !important;     
}

/* Ribbon */
.workspace-ribbon-collapse-btn{
    margin: 0px;
    padding-top: 10px;
    padding-bottom: 10px;
}
.workspace-ribbon.mod-left{
    border-right: solid var(--border)  !important;
    border-width: 1px !important;
}
.workspace-ribbon.mod-right{
    border-left: solid var(--border)  !important;
    border-width: 1px !important;
}
.side-dock-settings{
    margin-bottom: 25px !important;
}

/* Tabs */
.workspace-tabs{
    background-color: var(--tabs);
}
.workspace-tabs>.workspace-leaf,
.workspace-tab-header-container,
.workspace-tab-header-inner,
.workspace-tab-header{
    background: transparent !important;
}
.workspace-tab-container-after,
.workspace-tab-container-before{
    width:0px;
}
.workspace-tab-header-container{
    border-bottom: solid var(--border)  !important;
    border-width: 1px !important;
    padding: 5px;
    height: 34px;
}
.nav-header{
    padding: 0px;
}
.nav-buttons-container{
    padding: 5px;
    height: 36px;
    margin: 0px !important;
    border-width: 0px !important;
}
.nav-action-button{
    padding: 3px 8px !important;
    margin: 0px 4px !important;
    border-radius: 2px ;
}

/* Search results in tabs */
.search-result-file-title{
    font-size: 1rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.search-result{
    background-color:var(--search-result);
    border-radius: 2px;
    padding: 5px;
    margin: 0px 10px 10px 10px;
}
.search-result-container{
    margin: 0px !important;
    padding: 0px !important;
}
.search-result-file-matched-text{
    background-color:var(--matched-text);
}
.side-dock-collapsible-section-header{
    margin: 5px;
}


/* Prompt and Setting Panel*/
.prompt-input{
    border-radius: 2px !important;
}
.prompt,
.modal{
    border-radius: 2px;
    border: solid rgb(0,0,0,0.5);
    border-width: 1px;
}
.modal-bg{
    background: rgb(0,0,0,0.4);
}

/* make the resize handler smaller */
.workspace-split.mod-horizontal > * > .workspace-leaf-resize-handle {
    height:1px;
    background:var(--border);
}
.workspace-split.mod-vertical > * > .workspace-leaf-resize-handle,
.workspace-split.mod-left-split > .workspace-leaf-resize-handle,
.workspace-split.mod-right-split > .workspace-leaf-resize-handle {
    background:var(--border) ;
    width:1px;
}
.workspace-tabs,
.workspace-leaf,
.workspace-split,
.workspace-leaf-content {
    padding-right: 0px !important;
    padding-left: 0px !important;
}

/* Smaller scroll-bars*/
::-webkit-scrollbar{
    background: transparent;
    width: 5px;
    height: 5px;
}

/*Menu Item*/
.menu-item{
    height: 29px;
    padding: 2px 10px;
}
