/* Custom styles for Brain Notes */

.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--pico-border-radius);
    background: var(--pico-card-background-color);
    box-shadow: var(--pico-card-box-shadow);
    border-left: 4px solid var(--pico-primary-background);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Sidebar transitions and mobile view */
.layout-with-sidebar {
    display: flex;
    align-items: flex-start;
    gap: var(--pico-grid-column-gap);
}

#sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* Основний контент займає решту простору */
.layout-with-sidebar > section,
.layout-with-sidebar > article {
    flex-grow: 1;
    min-width: 0; /* Запобігає виходу за межі флекс-контейнера */
}

@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 280px;
        background: var(--pico-background-color);
        z-index: 1001;
        transition: left 0.3s ease;
        padding: 1rem;
    }
    #sidebar.open {
        left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    .sidebar-overlay.open {
        display: block;
    }
}
/* Компактний перемикач мов */
ul li .lang-switcher {
    position: relative;
    display: inline-block;
    margin: 0;
    vertical-align: middle;
}
ul li .lang-switcher summary { padding: 0 7px; }

/***********/
/*  TAGs   */
/***********/
.tags-cloud span {
    cursor: pointer;
    color: var(--pico-form-element-invalid-border-color);
    font-size: 0.8rem;

    display: inline-flex; 
    align-items: center; 
    margin: 0.1rem; 
    border: 1px solid var(--pico-muted-border-color); 
    border-radius: var(--pico-border-radius); 
    padding: 0.2rem 0.4rem;
}
.tags-cloud button {
    margin-right: 0.1rem; 
    margin-bottom: 0.1rem; 
    padding: 0.1rem 0.4rem; 
    font-size: 0.7rem;
}

.tags-cloud span:hover,
.tags-cloud button:hover {
    background-color: #eee;
}
/***********
 * Sidebar *
 ***********/

#sidebar.sidebar-logo {
    display: block;
    text-align: center;
}
.user-hello { text-align: center; }

#side-notebook-selector {
    border-radius:.6rem;
    border: 1px solid #bbb;
}
#notebook-select {
    margin: 0;
    border-radius: 2rem;
    padding: 3px 12px;
}

#section-tree {
    font-size: .8rem;
    overflow-x: hidden;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    background-color: transparent;
}

/* jsTree overrides to match Pico CSS */
@media (max-width: 768px) {
  #section-tree.jstree-default-dark-responsive .jstree-wholerow,
  #section-tree.jstree-default-responsive .jstree-wholerow {
    border: none;
    height: 40px;
    background-color: transparent;
  }
  #section-tree.jstree-default-responsive .jstree-children .jstree-open > .jstree-wholerow {
    box-shadow: none;
    border-top: 1px solid #bbb;
  }
 #section-tree.jstree-default-responsive .jstree-children .jstree-last > .jstree-wholerow {
    box-shadow: none;
    border-bottom: 1px solid #bbb;
  }
  #section-tree.jstree-default-responsive .jstree-anchor {
    font-weight: normal;
    font-size: 1rem;
    text-shadow: none;
  }
}

/* Tree Node Actions */
.node-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}
.node-actions {
    margin-left: auto;
    display: none;
    padding-right: 0.5rem;
}
.node-wrapper:hover .node-actions {
    display: flex;
    gap: 0.5rem;
}
.node-action-btn {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--secondary);
    transition: color 0.2s;
}
.node-action-btn:hover {
    color: var(--primary);
}
