@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400&display=swap');
@import url('./themes.css');

* {
    box-sizing: border-box;
}

/* =====================
   Layout
   ===================== */
html, body {
    height: 100%;
    margin: 0;
}

body {
    margin: 0;
    color: var(--font-primary);
    overflow: hidden;
    font-family: var(--font);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: var(--bg-primary);
    width: 100vw;
    height: 100vh;
}

main {
    display: flex;
    max-width: 100%;
    height: 100vh;
    min-height: 0;
    max-height: 100vh;
}

input:focus {
    outline: none;
}

hr {
    width: 100%;
    border: none;
    border-top: 1px solid var(--border-default);
}

a {
    color: var(--accent);
}

/*scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--background-tertiary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--background-secondary);
}

/* =====================
   Navigation
   ===================== */
#nav-bar {
    height: 100vh;
    min-width: 40px;
    margin: 0;
    padding: var(--padding-small);
    background-color: var(--bg-tertiary);
    list-style: none;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-primary);
}

.nav-item {
    width: 100%;
    aspect-ratio: 1;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.nav-item:hover {
    cursor: pointer;
    background-color: var(--hover-dark);
}

#open-files-btn {
    background-image: url('../assets/logo.svg');
}

#visualizer-btn {
    background-image: url('../assets/visualizer.svg');
}

#daily-note-btn {
   background-image: url('../assets/dailynote.svg'); 
}

/* =====================
   File Display
   ===================== */
#file-display {
    height: 100%;
    min-height: 0;
    width: auto;
    min-width: 0;
    flex: 1;
}

#tab-bar {
    height: 42px;
    width: 100%;
    max-width: 100%;
    padding: 0;
    padding-left: 15px;
    padding-bottom: 2px;
    margin: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: end;
    justify-content: flex-start;
    position: relative;
    z-index: 200;
    background-color: var(--bg-tertiary);
    overflow: clip;
    overflow-clip-margin: 10px;
}

.tab-card {
    flex: 1 1 150px;
    min-width: 60px;
    max-width: 150px;
    height: 65%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--padding-large);
    border: none;
    border-top-right-radius: 3px;
    border-top-left-radius: 3px;
    font-size: 0.8rem;
    overflow: hidden;
    position: relative;
    color: var(--font-secondary);
    font-size: 0.7rem;
}

.tab-card-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-card:hover {
    cursor: pointer;
    color: var(--font-primary);
}

.current-tab {
    background-color: var(--bg-primary);
    color: white;
    height: calc(65% + 6px);
    z-index: 2;
    position: relative;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    border: none;
    border-top: 1px solid var(--border-primary);
    border-left: 1px solid var(--border-primary);
    border-right: 1px solid var(--border-primary);
    margin-bottom: -3px;
    background-color: var(--bg-primary);
    z-index: 403;
}

.current-tab button {
    background-color: var(--bg-primary);
    color: var(--font-tertiary);
}

.close-tab-btn {
    background-color: inherit;
    color: transparent;
    border: none;
    font-size: 0.7rem;
}

.tab-card:hover .close-tab-btn,
.current-tab .close-tab-btn {
    color: var(--font-tertiary);
}

.close-tab-btn:hover {
    cursor: pointer;
    color: var(--font-primary) !important;
}

#current-tab {
    height: calc(100vh - 43px);
    position: relative;
    padding-bottom: 50px;
    background-color: transparent;
    z-index: 100;
    border-top: 1px solid var(--border-primary);
}

.persistent-title {
    position: absolute;
    top: 0;
    left: 50%;
    width: 100%;
    background-color: var(--bg-primary);
    transform: translateX(-50%);
    font-size: 0.85rem;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--font-tertiary);
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.05em;
}

.auto-save-indicator{
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  height: 20px;
  border: 1px solid black;
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: var(--padding-small);
  border-radius: var(--border-radius-medium);
  font-size: 0.7rem;
  gap 5px;
}

.save-icon {
    height: calc(100% + 5px);
    aspect-ratio: 1;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.tab::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.tab {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}  


/* =====================
   Search Menu
   ===================== */
#search-menu {
    background-color: var(--bg-tertiary);
    height: 500px;
    width: 500px;
    overflow: hidden;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-small);
}

#search-results {
    width: 100%;
    height: 90%;
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    display: flex;
    flex-direction:column;
    gap: 10px;
    scrollbar-width: 0;
}

#search-results::-webkit-scrollbar {
  display: none;
}

#close-search-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--font-secondary);
    cursor: pointer;
}

#close-search-btn:hover {
    color: var(--font-primary);
}

#search-bar {
    color: var(--font-primary);
    width: 450px;
    height: 10%;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-small);
    border: 1px solid var(--border-default);
    font-size: 0.95rem;
    padding: 5px 10px;
    caret-color: var(--caret);
}

.search-result {
    padding: 15px;
    border: 1px solid var(--border-primary);
    height: 50px;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: start;
    font-size: 0.9rem;
    border-radius: var(--border-radius-small);
    color: var(--font-primary);
}

.search-result:hover {
    background-color: var(--bg-secondary);
    cursor: pointer;
}

.search-result-img {
    height: 100%;
    opacity: 0.6;
}

.search-result-span {
    height: 100%;
    display: flex;
    max-width: 70%;
    overflow: hidden;
    align-items: center;
    gap: 5px;
}

.search-result-text {
    height: 100%;
}

.search-result-date-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 100%;
    gap: 5px;
    color: var(--font-secondary);
    font-size: 0.8rem;
}

/* =====================
   Default Page
   ===================== */
.default-page {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 8px;
}

.default-page-text {
    color: var(--font-tertiary);
    z-index: 3;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* =====================
   Editor
   ===================== */
.tab {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    position: relative;
    overflow-y: scroll;
    padding-top: 40px;
}

.note-title {
    height: 100px;
    background-color: transparent;
    color: var(--font-primary);
    font-size: 1.5rem;
    padding-left: 50px;
    border: none;
    font-family: 'Noto Serif JP', serif;
    caret-color: var(--caret);
    width: 900px;
    margin-top: auto;
    font-family: var(--font);
    padding-top: 25px;
}

.note-body-input,
.note-body-markdown {
    min-height: 100%;
    border: none;
    outline: none;
    color: var(--font-primary);
    font-size: var(--font-size);
    padding: 0 50px 50px 50px;
    flex-direction: column;
    font-family: 'Noto Serif JP', serif;
    caret-color: var(--caret);
    line-height: 1.8;
    resize: none;
    width: 900px;
    padding-top: 5px;
    padding-bottom: 90px;
    font-family: var(--font);
    background-color: var(--bg-primary);
    margin-bottom: auto;
    overflow: hidden;
    flex-shrink: 0;
}

.note-body-input {
    resize: none;
    padding-top: 20px;
}

.note-body-input::-webkit-scrollbar {
  display: none;
}

.note-body-input:focus {
    outline: none;
}


/* =====================
   Count Holder
   ===================== */
.count-holder {
    position: absolute;
    bottom: 5px;
    right: 5px;
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-small);
    height: 25px;
    width: 200px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    background-color: var(--bg-secondary);
    font-size: 0.75rem;
    color: var(--font-tertiary);
}

.note-mode-img {
    height: 60%;
    aspect-ratio: 1;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

.note-mode-img.display-mode {
    background-image: url('../assets/eye.svg');
}

.note-mode-img.edit-mode {
    background-image: url('../assets/edit.svg');
}

/* =====================
   Search Create Note
   ===================== */
.menu-create-note-btn {
    color: var(--gold);
    border: 1px solid var(--border-default);
    height: 100%;
    width: 20%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    border-radius: var(--border-radius-small);
}

.menu-create-note-btn:hover {
    background-color: var(--gold-subtle);
}

/* =====================
   Quick Capture
   ===================== */
.quick-capture {
    position: fixed;
    top: 50vh;
    left: 50vw;
    transform: translate(-50%, -50%);
    background-color: var(--bg-tertiary);
    border: 3px solid var(--border-tertiary);
    border-radius: var(--border-radius-medium);
    z-index: 99;
    padding: 20px;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--font-tertiary);
}

.quick-capture input {
    background-color: var(--bg-secondary);
    border: none;
    border-bottom: 1px solid var(--border-default);
    padding: 5px;
    width: 100%;
    caret-color: var(--caret);
    font-family: 'Noto Serif JP', serif;
}

#settings {
    height: 800px;
    width: 600px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-tertiary);
    color: var(--font-tertiary);
}

#settings-btn {
    background-image: url('../assets/settings.svg');
    background-position: center;
    background-size: contain;
}

input[type="checkbox"]:hover {
    cursor: pointer;
}
