/* --- Memo Tab --- */
#tab-memo {
    padding: 0;
}

#tab-memo .split-sidebar {
    border-right: 1px solid var(--border-color);
    padding: 1rem;
}

#tab-memo .split-main {
    padding: 1rem;
}

.memo-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.memo-list-header h3 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.2rem;
}

#newMemoBtn {
    font-size: 1.2rem;
    padding: 0.2rem 0.6rem;
    background-color: rgba(0, 0, 0, 0);
}

#memo-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.memo-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    background-color: var(--secondary-bg);
    border-left: 5px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

.memo-list-item:hover {
    background-color: var(--border-color);
}

.memo-list-item.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.memo-list-item .memo-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid var(--text-color);
}

#memo-editor-container {
    height: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#memo-editor-container.hidden {
    display: none;
}

#memo-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: var(--secondary-color);
    font-size: 1.2rem;
}

#memoTitle {
    flex-grow: 1;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 6px;
}

#memoTitle:focus {
    outline: none;
    background-color: var(--secondary-bg);
}

.memo-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

#memo-color-palette {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 10px 0px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.2);
}

#deleteMemoBtn {
    background-color: transparent;
    border: none;
    color: var(--danger-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

#deleteMemoBtn:hover {
    color: #c82333;
}

#memo-area {
    width: 100%;
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--input-text);
    resize: none;
    transition: background-color 0.3s ease;
}

/* --- Pinned Memo in Header --- */
#pinned-memo-container {
    margin-left: auto; /* Push to the right */
    display: flex;
    gap: 0.5rem;
    align-items: center;
    max-width: 50%;
}

.pinned-memo {
    padding: 0.75rem;
    border-radius: 4px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    max-width: 180px;
    flex-shrink: 0;
}

/* Add varied rotation for visual appeal */
.pinned-memo:nth-child(1) { transform: rotate(2deg); }
.pinned-memo:nth-child(2) { transform: rotate(-1.5deg); }
.pinned-memo:nth-child(3) { transform: rotate(1deg); }
.pinned-memo:nth-child(4) { transform: rotate(-2deg); }
.pinned-memo:nth-child(5) { transform: rotate(2.5deg); }
.pinned-memo:nth-child(6) { transform: rotate(-1deg); }
.pinned-memo:nth-child(7) { transform: rotate(1.5deg); }


.pinned-memo h5 {
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    word-break: break-all;
}

.pinned-memo p {
    margin: 0;
    font-size: 0.8rem;
    max-height: 40px; /* Limit height */
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.memo-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto; /* Push to the right end of the memo-header flex container */
}