/* Story Map — Notes Drawer (Selector de Notas)
   Discreto colapsado; expandido: esquina inferior derecha, 50vw x 50vh.
*/

.notes-drawer {
    position: fixed;
    left: 12px;
    right: auto;
    bottom: 12px;
    width: 50vw;
    height: 50vh;
    max-width: 820px;
    max-height: 720px;
    min-width: 420px;
    min-height: 360px;

    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 21, 27, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);

    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 5000;
}

.notes-drawer.is-collapsed {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    border-radius: 999px;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
}

.notes-drawer.is-collapsed .notes-drawer-header,
.notes-drawer.is-collapsed .notes-drawer-body {
    display: none;
}

.notes-drawer-tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.notes-drawer:not(.is-collapsed) .notes-drawer-tabs {
    display: none;
}

.trash-dropzone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 80px;
    height: 64px;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 21, 27, 0.75);
    color: rgba(230, 237, 246, 0.90);
    font-size: 11px;
    cursor: default;
    user-select: none;
}

.trash-dropzone .trash-text {
    font-size: 11px;
    line-height: 1;
    opacity: 0.92;
}

.trash-dropzone .trash-icon {
    opacity: 0.95;
    width: 22px;
    height: 22px;
    display: block;
    margin: 0 auto;
    fill: currentColor;
}

.trash-dropzone:hover {
    background: rgba(22, 26, 34, 0.80);
}

.trash-dropzone.drop-target {
    border-color: rgba(255, 86, 86, 0.85);
    background: rgba(255, 86, 86, 0.12);
    color: rgba(255, 210, 210, 0.98);
}

.notes-drawer-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 21, 27, 0.75);
    color: rgba(230, 237, 246, 0.92);
    font-size: 11px;
    cursor: pointer;
}

.notes-drawer-tab:hover {
    background: rgba(22, 26, 34, 0.80);
}

.notes-drawer:not(.is-collapsed) .notes-drawer-tab {
    display: none;
}

.notes-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.notes-drawer-title {
    font-weight: 700;
    font-size: 13px;
    opacity: 0.95;
}

.notes-drawer-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.notes-drawer-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(230, 237, 246, 0.90);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

.notes-drawer-btn:hover {
    background: rgba(255, 255, 255, 0.09);
}

.notes-drawer-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.drawer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
}

.drawer-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.drawer-search,
.drawer-tags {
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.22);
    color: rgba(230, 237, 246, 0.92);
    padding: 0 10px;
    outline: none;
}

.drawer-search {
    width: min(380px, 46vw);
}

.drawer-tags {
    width: min(230px, 30vw);
}

.drawer-btn {
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(230, 237, 246, 0.92);
    padding: 0 10px;
    cursor: pointer;
    font-size: 12px;
}

.drawer-btn:hover {
    background: rgba(255, 255, 255, 0.09);
}

.drawer-btn.is-selected {
    border-color: rgba(90, 160, 255, 0.55);
    background: rgba(90, 160, 255, 0.16);
}

.drawer-btn-dir {
    width: 34px;
    padding: 0;
    text-align: center;
}

.drawer-results-pill {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: rgba(230, 237, 246, 0.88);
    white-space: nowrap;
}

.drawer-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
}

.drawer-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    font-size: 12px;
}

.drawer-tag-chip button {
    border: none;
    background: transparent;
    color: rgba(230, 237, 246, 0.75);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.drawer-menu {
    position: fixed;
    background: rgba(18, 21, 27, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    padding: 8px;
    display: none;
    z-index: 6000;
    min-width: 220px;
}

.drawer-menu.is-open {
    display: block;
}

.drawer-menu-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(230, 237, 246, 0.90);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
}

.drawer-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.drawer-menu-item.is-selected {
    background: rgba(90, 160, 255, 0.14);
    border-color: rgba(90, 160, 255, 0.40);
}

.drawer-results {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 12px;
}

.drawer-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 120px);
    gap: 10px;
    align-content: start;
    justify-content: start;
}

.drawer-sentinel {
    height: 1px;
}

@media (max-width: 980px) {
    .notes-drawer {
        width: calc(100vw - 24px);
        height: 50vh;
        min-width: 0;
    }

    .drawer-search {
        width: calc(100vw - 24px - 24px);
        max-width: 100%;
    }
}