/* ==========================================================================
   MEIN NOTIZBUCH - CAFÉ ESPRESSO THEME
   ========================================================================== */

:root {
    --bg-main: #3d312a;
    --panel-bg: #f4efe9;
    --border-color: #c5b4a0;
    --text-color: #2b211b;
    --accent-color: #8c5a3c;
    --accent-hover: #6e432b;
    --item-hover: #e8ded3;
    --item-selected: #d8c7b5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-color);
    font-family: 'Trebuchet MS', 'Lucida Sans', sans-serif;
    height: 100vh;
    overflow: hidden;
}


/* BASE CONTAINER */

[id^="nb"] {
    position: absolute;
    background-color: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    padding: 6px 10px;
    overflow: hidden;
}


/* ZEILE 1 */

#nbtitel {
    top: 0;
    left: 0;
    width: 14%;
    height: 6%;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

#nbtitel h1 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #f4efe9;
}

#nbname {
    top: 0;
    left: 14%;
    width: 86%;
    height: 6%;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: bold;
}


/* LINKE SPALTE */

#nbsuch {
    top: 6%;
    left: 0;
    width: 14%;
    height: 30%;
    display: block;
    overflow-y: auto;
}

#nbsuch input {
    width: 100%;
    font-size: 0.85rem;
}


/* FILTER */

#search-filters {
    margin-top: 8px;
}

#filter-kategorie {
    width: 100%;
    padding: 4px 5px;
    margin-bottom: 7px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.8rem;
}

#filter-tags-details {
    margin-bottom: 7px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
}

#filter-tags-details summary {
    padding: 5px 6px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

#filter-tags-details[open] summary {
    border-bottom: 1px solid var(--border-color);
}

#filter-tags {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 110px;
    overflow-y: auto;
    padding: 5px 6px;
    font-size: 0.78rem;
}

#filter-tags label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

#filter-tags input[type="checkbox"] {
    width: auto;
    flex: 0 0 auto;
}

#btn-filter-reset {
    width: 100%;
}


/* SUCHERGEBNISSE */

#nbfand {
    top: 36%;
    left: 0;
    width: 14%;
    height: 58%;
    overflow-y: auto;
    font-size: 0.85rem;
}

.search-item {
    font-size: 0.95rem;
    padding: 6px 8px;
    margin-bottom: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.search-item:hover {
    background-color: var(--item-hover);
}

.search-item.active {
    background-color: var(--item-selected);
    font-weight: bold;
}


/* MITTLERE SPALTE */

#nbnotiz,
#nbvorschau {
    top: 6%;
    left: 14%;
    width: 71%;
    height: 88%;
    overflow-y: auto;
    padding: 12px;
    background-color: var(--panel-bg);
    color: var(--text-color);
}

#nbnotiz {
    white-space: pre-wrap;
    word-break: break-word;
    outline: none;
}


/* RECHTE SPALTE */

#nbkmdo {
    top: 6%;
    left: 85%;
    width: 15%;
    height: 26%;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.kmdo-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

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

#nbkat {
    top: 32%;
    left: 85%;
    width: 15%;
    height: 34%;
    overflow-y: auto;
    cursor: pointer;
}

#nbtag {
    top: 66%;
    left: 85%;
    width: 15%;
    height: 34%;
    overflow-y: auto;
    cursor: pointer;
}

.box-title {
    font-weight: bold;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    padding-bottom: 2px;
}

.box-content div {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.box-content div:hover {
    background-color: var(--item-hover);
}

.box-content div.selected {
    background-color: var(--item-selected);
    font-weight: bold;
}


/* ZEILE 3 */

#nbcopy {
    top: 94%;
    left: 0;
    width: 14%;
    height: 6%;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: #c5b4a0;
}

#nbinfo {
    top: 94%;
    left: 14%;
    width: 71%;
    height: 6%;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    background-color: #e8ded3;
    padding: 0 12px;
    gap: 16px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-label {
    color: #6e594d;
    font-size: 0.85rem;
}

.info-value {
    color: var(--text-color);
}

.info-divider {
    color: var(--border-color);
    font-weight: 300;
}


/* BUTTONS UND INPUTS */

button {
    background-color: var(--accent-color);
    border: none;
    color: #fff8f0;
    font-family: inherit;
    font-weight: bold;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

button:hover {
    background-color: var(--accent-hover);
}

input {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: inherit;
    padding: 4px 6px;
    border-radius: 4px;
    width: 100%;
}


/* POPOVER */

.nb-popover {
    position: absolute;
    z-index: 1000;
    width: 250px;
    background-color: var(--panel-bg);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popover-title {
    font-weight: bold;
    font-size: 0.85rem;
}

.popover-actions {
    display: flex;
    gap: 4px;
}

.popover-actions button {
    flex: 1;
    padding: 6px 4px;
    font-size: 0.75rem;
}

.btn-danger {
    background-color: #a33b3b;
}

.btn-cancel {
    background-color: #8a7b70;
    flex: 0 0 32px !important;
}

#popover-kat {
    top: 32%;
    left: 66%;
}

#popover-tag {
    top: 66%;
    left: 66%;
}


/* PLACEHOLDER TITEL */

#nbname[contenteditable="true"]:empty::before {
    content: attr(placeholder);
    color: #888;
    pointer-events: none;
    display: block;
}


