:root {
    --orange: #ff8c00;
    --dark-orange: #ff6600;
    --light-blue: #00aaff;
    --darker-blue: #0077cc;
    --light-green: #74e165;
    --darker-green: #397114;
    --darker-red: #cc3333;
    --light-red: #ff6b6b;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent body scrollbars */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    padding: 1em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 150ch;
    min-width: 1080px;
    margin:0 auto;
    box-sizing: border-box;
    padding-bottom: 140px; /* Space for the keyboard */
}

.top-bar-container {
    margin-bottom: 1em;
    flex-shrink: 0;
    display: flex;
}

nav {
    background-color: #333;
    position: relative;
    display: flex;
    margin-right: 2px;
}

nav hr {
    width: 90%;
}

.menu {
    display: none;
    flex-direction: column;
    background-color: #2c2c2c;
    position: absolute;
    top: 50px;
    left: 0;
    width: 25ch;
    border-radius: 4px;
    border: 1px solid white;
}

.menu a {
    color: white;
    text-decoration: none;
    padding: 12px 16px;
    display: block;
    transition: background 0.3s;
}

.menu a:hover {
    background-color: #555;
}

.menu.show {
    display: flex;
}

#menu-btn.show {
    border: 1px solid white;
}

#search-input {
    width: 100%;
    padding: 0.8em;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1em;
    box-sizing: border-box;
}

#search-input.searching {
    border-color: var(--light-blue);
}

#search-input::placeholder {
    color: #888888;
    opacity: 1;
}

#menu-btn, #search-clear {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: white;
    cursor: pointer;
    padding: 0 2ch;
}

#search-clear {
    margin-left: 2px;
}

#tags-container {
    min-width: 20ch;
    width: 25ch;
    display: flex;
}

.container {
    display: flex;
    gap: 1em;
    overflow: hidden;
    height: 100%;
}

.column.splitted > div {
    flex-basis: 50%;
    overflow-y: scroll;
    min-height: 200px;
}

.column.splitted > div:first-child {
    margin-bottom: 1ch;
}

.column {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 1em;
    display: flex;
    flex-direction: column;
}

#clips {
    flex-basis: 50%;
    flex-grow: 1;
}

h2 {
    color: var(--light-blue);
    font-size: 1.2em;
    margin: 0 0 1em 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5em;
    white-space: nowrap;
}

ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.column ul {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px; /* space for scrollbar */
}

li {
    padding: 0.8em 1em;
    margin-bottom: 0.5em;
    background-color: #2c2c2c;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-left: 3px solid transparent;
}

li:not(.selected,.active):hover {
    background-color: #3a3a3a;
    border-left: 3px solid var(--light-blue);
}

li.active {
    background-color: var(--light-blue);
    color: #121212;
    font-weight: bold;
    border-left: 3px solid var(--darker-blue);
}

li:not(.selected,.active):hover {
    background-color: #3a3a3a;
    border-left: 3px solid var(--light-blue);
}

li.user-tag {
    background-color: #3a3a3a;
}

li.user-tag:hover {
    border-left: 3px solid var(--light-green);
}

li.user-tag.active {
    background-color: var(--light-green);
    border-left: 3px solid var(--darker-green);
}

.remove-tag-btn {
    background-color: var(--darker-red);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 2.2ch;
    height: 2.2ch;
    margin-left: 1ch;
}

a.user-tag:not(.editable) .remove-tag-btn {
    display: none;
}

.clip-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    padding: 1em;
    border: 2px solid transparent;
    cursor: auto;
}

.clip-item:not(.selected) {
    border-left: 3px solid transparent;
}

.clip-item.selected {
    border-color: var(--orange);
}

.clip-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 10px;
}

.clip-title {
    cursor: pointer;
}

.breadcrumbs {
    font-size: 0.9em;
    color: var(--dark-orange);
    font-weight: bold;
    margin-top: 4px;
}

.clip-tags {
    margin-top: 5px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
}

.clip-tags a {
    color: var(--light-blue);
    text-decoration: none;
    background-color: #333;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 5px;
    font-size: 0.8em;
}

.clip-tags a:hover {
    background-color: var(--light-blue);
    color: #121212;
}

.clip-tags a.add-tag {
    color: var(--dark-orange);
    cursor: pointer;
}

.clip-tags a.add-tag:hover {
    background-color: var(--dark-orange);
    color: #121212;
}

.clip-tags a.user-tag {
    color: var(--light-green);
}

.clip-tags a.user-tag:hover {
    background-color: var(--light-green);
    color: #121212;
}

.waveform-container {
    margin-bottom: 10px;
    height: 60px;
    cursor: pointer;
}

.waveform-container.load-error {
    border: 1px solid #947171;
    background-color: #ff000017;
}

.waveform-container.load-error::before {
    content: "⚠ ERROR: File could not be loaded (not found?)";
    padding-left: 1ch;
    color: var(--light-red);
    width: 100%;
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: center;
}

.waveform-container .hidden {
    display: none;
}

.clip-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.clip-buttons {
    display: flex;
    justify-content: flex-end;
}

.clip-buttons button {
    background-color: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 0.4em 0.8em;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 0.5em;
    transition: all 0.2s ease;
    width: 40px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    font-size: 1.1em;
    font-weight: bold;
}

.clip-buttons button:hover {
    background-color: #555;
}

.clip-buttons button.active {
    background-color: var(--light-blue);
    color: #121212;
    border-color: var(--darker-blue);
}

#piano-keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1e1e1e;
    padding: 10px;
    box-sizing: border-box;
    border-top: 1px solid #333;
    z-index: 10;
    transition: transform 0.3s ease-in-out;
}

#selected-clip-display {
    color: #ff8c00;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 10px;
    height: 1.2em; /* Reserve space */
}

#selected-clip-display:empty {
    display: none;
}

.piano-keys {
    display: flex;
    height: 80px;
}

#piano-keyboard.hidden {
    transform: translateY(100%);
}

#toggle-piano {
    position: fixed;
    bottom: 10px;
    right: 20px;
    background-color: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 0.4em 0.8em;
    border-radius: 3px;
    cursor: pointer;
    z-index: 20;
}

.key {
    border: 1px solid #333;
    border-radius: 0 0 3px 3px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.key.white {
    background-color: #f7f7f7;
    width: 50px;
    height: 100%;
}

.key.white:active {
    background-color: #ddd;
}

.key.black {
    background-color: #333;
    width: 30px;
    height: 60%;
    margin-left: -15px;
    margin-right: -15px;
    z-index: 2;
    border-color: #555;
}

.key.black:active {
    background-color: #555;
}

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

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.waveform-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    background-color: #2c2c2c;
    border: 2px dashed #555;
    border-radius: 3px;
    cursor: pointer;
    color: #aaa;
    font-style: italic;
    transition: all 0.2s ease-in-out;
}

.waveform-placeholder:hover {
    background-color: #3a3a3a;
    border-color: var(--light-blue);
    color: #fff;
}

.clip-buttons button.favorite {
    color: #e0e0e0;
    font-size: 1.3em;
}

.clip-buttons button.favorite.active {
    background-color: transparent;
    color: var(--darker-red);
    border-color: white;
    font-size: 1.3em;
}

#favorites-category {
    background-color: #3a3a3a;
    border-left: 3px solid var(--light-red);
}

#favorites-category.active {
    background-color: var(--light-red);
    color: #121212;
    font-weight: bold;
    border-left: 3px solid var(--darker-red)
}

.floating-tooltip {
    position: fixed;
    transform: translate(-50%, 0);
    z-index: 9999;
    background-color: #1b1b1b;
    border: 1px solid white;
    padding: 1ch;
}
